The Daily Click ::. Forums ::. Klik Coding Help ::. Sine Wave Movement and Collisions
 

Post Reply  Post Oekaki 
 

Posted By Message

The Gaffer



Registered
  15/09/2008
Points
  2
15th September, 2008 at 22:41:09 -

Hi All,

Just wondered if the following was possible.

Have got a ghost enemy in my game and am trying to get the movement right. Sinewave obviously gives quite a nice floating effect, however when the enemy hits a wall I need it to change direction (ie if he hits a south wall go off at any random angle between 270 to 90) and bounce doesn't seem to work (created a wall and the enemy just goes right through instead of bouncing off)

Is there a way to do this with sinewave or am i better getting the maths books out!?

Cheers

 
n/a

Codemonkey

Always Serious

Registered
  06/11/2007
Points
  164

Code MonkeyKlikCast StarVIP MemberAttention GetterWii Owner360 OwnerThe Cake is a LieCardboard BoxHero of TimeI'm a Storm Trooper
I'm on a BoatIt's-a me, Mario!PS3 OwnerSonic SpeedGOTM - SEPTEMBER 2009 - WINNER!Evil klikerPokemon Ball!I am an April Fool
15th September, 2008 at 22:42:24 -

Just make him bob in the animation and give him bouncing ball movement.

 
You can log off any time you like, but you can't ever leave.

Muz



Registered
  14/02/2002
Points
  6499

VIP MemberI'm on a BoatI am an April FoolHonored Admin Alumnus
16th September, 2008 at 09:50:14 -

Well, you can't combine sinewave movement with bouncing ball if that's what you're trying to do. It's either fully custom, fully built-in movement, or a heck lot of bugs. Codemonkey's solution is the easiest

Also, one problem with doing it with sinewave is that you're actually making him change position, not just making him look like he is. So, he'll be bumping into things a lot.

 
Disclaimer: Any sarcasm in my posts will not be mentioned as that would ruin the purpose. It is assumed that the reader is intelligent enough to tell the difference between what is sarcasm and what is not.

Image

The Gaffer



Registered
  15/09/2008
Points
  2
16th September, 2008 at 13:12:00 -

Cheers Guys I'll have a play with the bouncing ball option and see what I can get the damn thing to do!

 
n/a
   

Post Reply



 



Advertisement

Worth A Click