The Daily Click ::. Forums ::. Klik Coding Help ::. player hurt thing
 

Post Reply  Post Oekaki 
 

Posted By Message

johnpow66



Registered
  21/12/2009
Points
  399
20th April, 2010 at 19:46:43 -

ok so im trying to have the player like bounce back when he gets hit by a enemy like uve seen in so many games such as megaman , castlevania etc etc.. any 1 kno how 2 do it ty for reading this

 
Behold my emoticon army and there really white teeth glory!

MBK



Registered
  07/06/2007
Points
  1578

VIP Member
20th April, 2010 at 21:39:03 -

yea ... I always hated the way they did it in alot of games though cause it'd mess me by changing the direction you get knocked back in some weird way .... I believe it's by the direction the character is facing, which is so wrong to me.

It's easy to do it that way though, just if char facing direction right, enemy collides with char, set xpos(char) to xpos(char) - 5
And if left, enemy collides, xpos + 5.
Or something along those lines.
Oh, and make a blinking phase happen for a few moments so it won't keep knocking you continuously.
While blinking phase not playing --> knockback code from what i said above, and do damage to char

I'd rather do it by positional testing though, instead of directions, so if char is x in relation to enemy and enemy collides char, bounce char back, and so on for the other directions.

If you wanna do it the really easy but crappy way, you could just use a default movement and bounce, then add in the blinking phase i mentioned.

btw, are you JRP?


 
Click Me! http://www.create-games.com/project.asp?view=main&id=1444

http://www.mediafire.com/download.php?aoo1dnnlq5i

Blood of the Ancient One, Seen only as Shadow, Faster than Lightning, Fierce as the Greatest Dragon, Nearly Invisible, Floating in a Dream, Entered through the Demon Door, Destroyer of Evil in a Realm with a Red Sky Scarred, Who could I be ?

johnpow66



Registered
  21/12/2009
Points
  399
21st April, 2010 at 04:56:32 -

hey dudee nice reply thanks for ya help and yep iam jrp back from the dead, with a Vengeance

 
Behold my emoticon army and there really white teeth glory!

MBK



Registered
  07/06/2007
Points
  1578

VIP Member
21st April, 2010 at 05:16:45 -

SWEET! .. Welcome back dude!


 
Click Me! http://www.create-games.com/project.asp?view=main&id=1444

http://www.mediafire.com/download.php?aoo1dnnlq5i

Blood of the Ancient One, Seen only as Shadow, Faster than Lightning, Fierce as the Greatest Dragon, Nearly Invisible, Floating in a Dream, Entered through the Demon Door, Destroyer of Evil in a Realm with a Red Sky Scarred, Who could I be ?

johnpow66



Registered
  21/12/2009
Points
  399
21st April, 2010 at 11:31:25 -

thankss!!!!!! mann . . .

 
Behold my emoticon army and there really white teeth glory!
   

Post Reply



 



Advertisement

Worth A Click