The Daily Click ::. Forums ::. Klik Coding Help ::. bounce back with platform movement object?
 

Post Reply  Post Oekaki 
 

Posted By Message

siven

I EAT ROCKS

Registered
  03/11/2008
Points
  604

Wii OwnerVIP Member
9th October, 2010 at 00:51:37 -

ive been wondering how to make a character bounce back when you touch an enemy with the pmo, like in zelda and what not. anybody know how?

 
[Game design makes my brain feel like its gonna explode.]

Billybobjoe198



Registered
  12/01/2007
Points
  221
9th October, 2010 at 01:50:10 -

The way I would do it is, (Probably not the best way)
Make a counter that every 50 ms gets 1 subtracted from it.
Said counter has a minimal value of 0 and an initial value of 0.
When touched by an enemy the counter would be set to a value based upon how far back you want to bounce (If you want it to vary I would use an active object that changes direction and every 50 ms would - 1 dir until it reached down, down would be a substitute for 0, and you would make it randomly choose a direction to for the object to look when the character contacts the enemy)
You would make it so While Counter > 0 move player - 2x (If they were to need to move left)
And if you you could be collided from multiple directions you would need multiple counters that would react based off of the enemies direction.

I don't know how well I explained that, but there's probably a better way.


 
n/a

OMC

What a goofball

Registered
  21/05/2007
Points
  3516

KlikCast Musician! Guy with a HatSomewhat CrazyARGH SignLikes TDCHas Donated, Thank You!Retired Admin
9th October, 2010 at 02:33:03 -

Set the PMO's X velocity to a large number in the appropriate direction (Negative to bounce left, positive to bounce right). Voila!

 

  		
  		
   

Post Reply



 



Advertisement

Worth A Click