Jump to content


Photo

Bounce?


  • Please log in to reply
8 replies to this topic

#1 freakmanguy

freakmanguy

    GMC Member

  • New Member
  • 147 posts

Posted 20 April 2009 - 09:18 PM

when a moving object collides with a non moving object, i want the moving object to bounce off it. but with the bounce dnd command, it either bounces againt all objects or just solid ones. i have to have it so it only bounces off just this one object. any ideas?

Edited by freakmanguy, 21 April 2009 - 01:15 AM.

  • 0

#2 wiiowner

wiiowner

    Absolute Zero Team

  • New Member
  • 685 posts

Posted 20 April 2009 - 09:32 PM

In the collision event with that one object use the bounce command (I might be wrong as I haven't used DnD in a while).
  • 0

#3 freakmanguy

freakmanguy

    GMC Member

  • New Member
  • 147 posts

Posted 20 April 2009 - 09:53 PM

In the collision event with that one object use the bounce command.

i tried that in the 1st place and thats exactly the problem... -.- if i use the dnd bounce command, it bounces like crazy off of other things like bullets and background stuff. i need something that does the same thing, but uses a different command(s). i want it only to bounce off this ONE object
  • 0

#4 wiiowner

wiiowner

    Absolute Zero Team

  • New Member
  • 685 posts

Posted 20 April 2009 - 09:58 PM

Hmm that's all I can think of at the moment, sorry I can't help you but if I think of something I'll let you know.

Edit: May I ask what shape that one object is?

Edited by wiiowner, 20 April 2009 - 10:07 PM.

  • 0

#5 freakmanguy

freakmanguy

    GMC Member

  • New Member
  • 147 posts

Posted 20 April 2009 - 11:05 PM

i really need this for a project! doesnt anybody know? im pretty sure this is a simple answer...

Edited by freakmanguy, 20 April 2009 - 11:06 PM.

  • 0

#6 King Chubbles

King Chubbles

    GMC Member

  • New Member
  • 1052 posts

Posted 20 April 2009 - 11:10 PM

In game maker 6 there was a sample game that showed a bouncing ball and you can click on it to make it bounce off the mouse, or you could let it bounce off of the blocks. you could look in that, im not sure if it comes with gmk7
  • 0

#7 freakmanguy

freakmanguy

    GMC Member

  • New Member
  • 147 posts

Posted 21 April 2009 - 01:14 AM

any idea where that example might be?
  • 0

#8 Desert Dog

Desert Dog

    GMC Member

  • Retired Staff
  • 6409 posts
  • Version:Unknown

Posted 21 April 2009 - 02:20 AM

put this in the collision code

speed = -speed;

or alternatively

direction = -direction;

You may need to add other stuff, to stop the ball from getting stuck. (like move_contact)

Good luck!

~DD
  • 0

#9 loverock125

loverock125

    GMC Member

  • GMC Member
  • 1829 posts
  • Version:GM8.1

Posted 21 April 2009 - 11:08 AM

If this is still unsolved then you could try in the collision event:

[codebox]if other.speed>0 then
{
exit
}

if other.speed=0
{
x=x-speed-number //the higher the number is ,the higher the bounce will be
}
[/codebox]

I Hope that helped
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users