Jump to content


Photo

Slowing Down Objects


  • Please log in to reply
2 replies to this topic

#1 da man7

da man7

    GMC Member

  • New Member
  • 16 posts

Posted 18 January 2008 - 10:05 AM

so, there is a ball, when its created is has a speed of 20. every second and every bounce, it gets -1 speed, can some one make up a script for this? u will be credited
(im really bad at gml as u might hv noticed)
  • 0

#2 Bomb505

Bomb505

    A Holy Angel

  • New Member
  • 223 posts

Posted 18 January 2008 - 10:13 AM

speed-=1

If speed doesn't work try hspeed or vspeed, it depends on your coding.
  • 0

#3 ch33zer

ch33zer

    GMC Member

  • New Member
  • 54 posts

Posted 18 January 2008 - 12:34 PM

in the create event
alarm[0]=room_speed //sets the alarm to 1 second
in the alarm[0] event
if speed<0 //if the ball is moving at all
{
speed-=1 //slow it down by one
alarm[0]=room_speed //reset the alarm to 1 second
}
in the collision with the ground event, which I will call obj_ground, change it to whatever your ground object is called
if speed<0
{
speed-=1
}

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users