Friday, January 17, 2020

Stencyl Day 4

In the last progress report i had 2 characters on a blank background who could move left so i have added even more code into the game first up proper walking.
 
This checks to make sure actor is on the ground to make them walk, wouldn't want them walking in mid air.
   
This is for collision so the actors don't phase through each other
Now that the ground detection code was in copied the code i used earlier to make them walk around properly next step the jump code, which is all compressed into one big code box.
 
Essentially what this code does is that when the down key is pressed the character jumps "sharply" "2" up then it checks to make sure that the character is both alive and on the ground so that the code can be repeated to make sure they cannot double jump, and the bottom segment of that code is so that the animation can change when the key is pressed however i do not have any animations made so far...

Here is the CSS code used to help assist the code making the actions and movements more precise than a simple code modulator.
Jumping:                                               Walking:
 

No comments:

Post a Comment