The Daily Click ::. Forums ::. Klik Coding Help ::. having trouble with bouncing movement
 

Post Reply  Post Oekaki 
 

Posted By Message

path



Registered
  4/3/2012 8:35:07 PM
Points
  10
8th August, 2012 at 8/8/2012 10:46:56 PM -

hey guys, im having trouble trying to perform a method to stop a bouncing ball movement, when colliding with obstacle or backdrop.
can some 1 plz help me or lead in me in the right direction?
also i think its not possible to stop a bouncing ball movement, is there any other way to make another movement for player to get hit and move back? I know theres something like
set x posistion to x("object")+1 but how do i stop the movement then if colliding with backdrop.

 
n/a

monkeytherat

Hero of Time Jr

Registered
  11/7/2010
Points
  1287

VIP MemberI donated an open source project
9th August, 2012 at 8/9/2012 12:15:42 AM -

In your events make an event that looks like this:

Object collides with a backdrop
-> stop

You can find stop under the movement when you right click on a square in the event editor.

If this doesn't work for some reason, you can give the object a flag and code like this:

Object collides with a backdrop
->set on flag 1

Is object's flag 1 is on?
-> stop

 
If you put a million monkeys at a million keyboards, one of them will eventually write a Java program.
The rest of them will write Perl programs.

path



Registered
  4/3/2012 8:35:07 PM
Points
  10
9th August, 2012 at 8/9/2012 1:18:54 AM -

ive tryed this but it doesnt work with the bouncing ball movement i dont think theres a way to actually stop
the bouncing ball movement unless somebody knows a method. theres the bounce command for it, but thats about it and all
that does is reverses the movement. does anybody know another method i can use to push the player back after getting hurt
and stoping the movemement when colliding with backdrop?









 
n/a

monkeytherat

Hero of Time Jr

Registered
  11/7/2010
Points
  1287

VIP MemberI donated an open source project
9th August, 2012 at 8/9/2012 1:41:45 AM -

I have a solution here: https://www.dropbox.com/s/bp2rxilfuxa1m7x/Application.mfa

It's kind of ugly and pretty buggy, but it would be a lot easier for you to have control over your objects if you didn't use any of the default movements.

 
If you put a million monkeys at a million keyboards, one of them will eventually write a Java program.
The rest of them will write Perl programs.

path



Registered
  4/3/2012 8:35:07 PM
Points
  10
9th August, 2012 at 8/9/2012 3:08:34 AM -

thx man, never thought of this.

 
n/a

monkeytherat

Hero of Time Jr

Registered
  11/7/2010
Points
  1287

VIP MemberI donated an open source project
9th August, 2012 at 8/9/2012 3:28:15 AM -

No problem. If anyone else has a better solution, please feel free to post it.

 
If you put a million monkeys at a million keyboards, one of them will eventually write a Java program.
The rest of them will write Perl programs.

nim



Registered
  5/17/2002
Points
  7049
9th August, 2012 at 8/9/2012 5:03:41 AM -

Stop doesn't work on an object that has been launched (i.e. "Launch object at speed 100")
Other than that, Stop works on Bouncing Ball objects. You must be doing something else wrong.

 
//

monkeytherat

Hero of Time Jr

Registered
  11/7/2010
Points
  1287

VIP MemberI donated an open source project
9th August, 2012 at 8/9/2012 5:42:40 AM -

I'm not sure about path's problem, but whenever I stopped a bouncing ball, it would be embedded in a wall, so I needed to create a loop to bring it out

 
If you put a million monkeys at a million keyboards, one of them will eventually write a Java program.
The rest of them will write Perl programs.

-UrbanMonk-

Professor Spectrum

Registered
  7/7/2008
Points
  6121

Has Donated, Thank You!Little Pirate!ARGH SignKliktober Special Award TagPicture Me This Round 33 Winner!The Outlaw!VIP MemberHasslevania 2!I am an April Fool
9th August, 2012 at 8/9/2012 6:17:26 AM -

I didn't check your link, but make sure you use "Collided with" and not "Overlap."
The collision detect command should perform the collision position adjustments automatically.

 
http://www.soapcow.com <- Flash games, featuring MMF made games!
http://www.jsoftgames.com <- Old blog I don't keep up anymore
   

Post Reply



 



Advertisement

Worth A Click