Fixing the Bear glitch

I added a new behavior to the bear called sine which sets the bear to patrol left and right and you can set it to be horizontal or vertical and set the distance it travels.

This makes it so much easier to code patrolling enemies in games

Bear code

This shows what difference I have made to it and how simple this new coding is compared to making him have variables and have about 6 pieces of coding. it was also very quick and wasn’t very hard to add to the game.


The video below is how I learnt and researched about the sine behavior.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s