JUMP AND CHANGE !!!
app-etite
Member Posts: 139
hi guys,
I have a character (actor) with a running animation. when you touch the screen he jumps ok, but..
when he jumps I want a different animation played... or a different image at the least.
I have tried with both change image and animate but when i preview it the original actors run cycle is flickering behind it.. please help ive been at it for dayyyyssss!
thanks
App-etite Studios
I have a character (actor) with a running animation. when you touch the screen he jumps ok, but..
when he jumps I want a different animation played... or a different image at the least.
I have tried with both change image and animate but when i preview it the original actors run cycle is flickering behind it.. please help ive been at it for dayyyyssss!
thanks
App-etite Studios
Comments
Let me know if this works
Ace
i have a jump boolean which which I have used in the runcycle. ( when attribute game.jump is true, change attribute self.motion.linearvelocityY to 500) (so that jumps while he runs)
then I have RULE when attribute self.Motion.linearvelocityY is more than 0.5 change image to "jump pic"... with a for 5 second timer on too. That just produces a quick flick but i want it to stay till it touches the ground again.
Im trying your way now.Thanks
The reason why it's flicking back is that if you have your animation set to 15 frames per second, 15 times in a second it is changing the image.
If you set it that it wont animate when jump is true, you shouldn't have a problem.
Ace
-App-etite
and if i keep clicking he keeps jumping higher and higher
any suggestions how to fix this.? thanks
-app-etite
-if actor collide with ground
----running animation
-else (otherwise)
----jumping animation
It should work just fine without any other attribute
'after 0.02, run to completion unchecked..
RULE inside of that
'actor recieves event' 'overlaps or collide' with 'actor of type' 'ground actor" then put my jump rule in there.
But, any ideas how to have the jump animation play after a quick touch and not a hold? if hold the screen he stays in the jump position until i let go.
thanks guys
-App-etite.
but wouldn't your solution make my character jump continuously? and also im using a boolean attribute for iphone touch screen. so when the player touches it my character jumps. can you explain more?
Thanks
-App-etite
Now for your question where you have when touched is pressed change jump to 1 and then after 0.2 seconds change attributeto 0, take that out and try it like this
Have a rule in your button when touch is pressed change jump to 1 then have another rule when touched is released change jump to 0.
Then whatt you want to do in the player is when attribute jump =1 change attribute self motion linear y to self motion linear y+100
do it like that instead of having a move up behavior or whatver for your jump.
Then lastly if you didnt already you should have a acceerlate down behavior relative to the scene sitting by itself in the player, and not in any rules. That will act as your gravity and bring the player back down after the jump.
At the moment I have when attribute game.jump is false animate the runcycle.
underneath i have when actor touches floor and game.jump is true or 1
ANIMATE
(animation)
and change velocity y
but it only plays one frame, one pic. and the player will stay in that pose until I let go off the touch. therefore the player can be just sliding along in a jump pose if the play was to hold the screen.. not good.
any thoughts
Thanks
now you should have a perfect jump with the animations working correctly
Everything works now.. Just need to tweak it..
Again thanks!
-app-etite