I am trying to make my sprite crouch down
When he crouches down, is not supposed to move.
However, When i press left or right, the detector moves, and he stays still. When i let go of the button, he goes to where the detector is.
Any way to fix?
Printable View
I am trying to make my sprite crouch down
When he crouches down, is not supposed to move.
However, When i press left or right, the detector moves, and he stays still. When i let go of the button, he goes to where the detector is.
Any way to fix?
I have not seen the Tutorial but my guess is that you just modify the action for left and right key strokes and add:
while key "down" is pressed. And negate it.
There was quite a similar thread about crouching using this movement a couple of days ago - the picture of the events might help you.
http://www.clickteam.com/epicenter/ubbthreads.php?ubb=showflat&Main=19608&Number=1396 51
Yeah I was just about to post the link to my thread, but DavidN beat me to it.
His solution to my problem works perfectly. So just use that. You may need to look at my events though to understand the solution, but there is a pic of them in that thread.
could you copy and paste that code into a file and upload it?
Because i dont when you turn the flags on/off. It would be a little bit helpful if saw the entire code.
Also, i only saw the answer to the decelleration and accerlation question, dont see one for just not making it move while crouching
Don't have time to upload an example right now, but I will later.Quote:
Originally Posted by Zabooza
But to make the player stop moving, you just switch on a flag when pressing down. While that flag is on, sex X Velocity (or Horiz) to zero. Release the down button (negate while holding down), shut the flag off. That stops the character from moving. To add the acceleration/deceleration you'll have to add what DavidN suggested in the thread.
there is still a problem
if the player presses down first and then left/right, it works pefectly
however if the player presses left/right first, it does not work (the problem this time is that the crouching animation is smaller than the height of the player when standing, so i have an event that lowers the y position so that it looks like he is still on the ground, and not crouching in mid-air)(if they press left/right, and the down key, they either A.make him look like he is in mid-air B.When they press left/right first and then down, he is walking, and it looks like he is walking in the ground
For crouch animations, never physically alter the Y position. Just simply make the crouch animation while leaving the canvas size the same height as the standing/stopped animation. Here is an example of what I mean (yes this sprite sucks. I made it in 2 seconds lol):Quote:
Originally Posted by Zabooza
http://i40.tinypic.com/2vbm0lz.jpg
That is a fine visual example Shawn, and your sprite is not what you said it was. LOL
Marv
Thanks! Well I guess the proportions of the sprite are okay. Obviously if I spent more time filling it out and completing it, it actually would look pretty decent.Quote:
Originally Posted by nivram