The Daily Click ::. Forums ::. Klik Coding Help ::. Platform Box Pushing.
 

Post Reply  Post Oekaki 
 

Posted By Message

Logiq



Registered
  09/04/2007
Points
  120
11th September, 2008 at 03:47:48 -

I want to be able to push a box in my platform game. Currently I am using the PMO for my character and everything seems to be working fine. I need the box to have gravity, but nothing too fancy. I was wondering if there is an article or tutorial on how to produce the things I want? Any help is greatly appreciated.

 
Hello guys! I'm New! -- I've been new for a year now...haha

-Finn-



Registered
  28/08/2008
Points
  445
11th September, 2008 at 08:37:57 -

hi well this is easy with PMO.

put another PMO and the object you want to push. Give it a name like Active 2. Set your char's name for example "Active".

Always>PMO2, set object to "Active 2"

PMO1, test for obstacle overlap
+Active collides with Active 2 >PMO1, object does overlap with an obstacle

PMO2, test for obstacle overlap
+Active 2 collides with the background >PMO2, object does overlap with an obstacle

Collision between Active and Active 2
+Active is facing right >PMO2, user is holding right key

Collision between Active and Active 2
+Active is facing left >PMO2, user is holding left key


Well, this should help you. Your Active 2 will move slowly, just increase the X Velocity for the PMO2 for moving the obstacle faster. If you want to make more objects, you will need more PMO's. A PMO per object.

have a nice day!


Image Edited by the Author.

 
Image

JetpackLover



Registered
  01/03/2007
Points
  212
11th September, 2008 at 08:59:49 -


Originally Posted by -Finn-
hi well this is easy with PMO.

put another PMO and the object you want to push. Give it a name like Active 2. Set your char's name for example "Active".

Always>PMO2, set object to "Active 2"

PMO1, test for obstacle overlap
+Active collides with Active 2 >PMO1, object does overlap with an obstacle

PMO2, test for obstacle overlap
+Active 2 collides with the background >PMO2, object does overlap with an obstacle

Collision between Active and Active 2
+Active is facing right >PMO2, user is holding right key

Collision between Active and Active 2
+Active is facing left >PMO2, user is holding left key


Well, this should help you. Your Active 2 will move slowly, just increase the X Velocity for the PMO2 for moving the obstacle faster. If you want to make more objects, you will need more PMO's. A PMO per object.

have a nice day!


Image Edited by the Author.



Are PMO's Memory intensive?

 
http://www.invincibletime.com/

Devlog for HD MMF Game Omulus. Check it out because it's gonna be awesome. http://omulus.tumblr.com/

Follow me on the twitters https://twitter.com/JetpackLover


-Finn-



Registered
  28/08/2008
Points
  445
11th September, 2008 at 09:09:46 -

what do you mean?

 
Image

JetpackLover



Registered
  01/03/2007
Points
  212
11th September, 2008 at 09:15:39 -

If you have a bunch of PMO's will it lag the game play much?

 
http://www.invincibletime.com/

Devlog for HD MMF Game Omulus. Check it out because it's gonna be awesome. http://omulus.tumblr.com/

Follow me on the twitters https://twitter.com/JetpackLover


-Finn-



Registered
  28/08/2008
Points
  445
11th September, 2008 at 09:27:46 -

i think it won't. But anyway, i dunno if you need more then 5 or 10 objects to be honest.

 
Image

Logiq



Registered
  09/04/2007
Points
  120
11th September, 2008 at 14:25:38 -

That sounds like a solid plan. Though I am worried that using that method may cause slow down. That is if the PMO is memory intensive. Can somebody get back to me on that. But Optimumly I would like to have all my objects have gravity. Any tips on that?

 
Hello guys! I'm New! -- I've been new for a year now...haha

OMC

What a goofball

Registered
  21/05/2007
Points
  3516

KlikCast Musician! Guy with a HatSomewhat CrazyARGH SignLikes TDCHas Donated, Thank You!Retired Admin
11th September, 2008 at 14:33:27 -

>.O There isn't a reason I could think of that would make PMO processor/memory intensive. Just test it. If not that, you can make simple gravity by setting the object's Y value to its Y value plus a value or counter when it's not overlapping a backdrop. (Or you could change the collision to be more accurate, whatever floats your boat) Then, while the object is not overlapping a backdrop, always add to that counter. You may want to have a limit though. Actually, people apparently use fast loops in their movements nowadays-- something I've never done before. So that may not be the best way.

 

  		
  		

Fifth

Quadruped

Registered
  07/05/2003
Points
  5815

VIP MemberGOTW JULY 2010 WINNER!Kliktober Special Award TagGOTW HALLOWEEN 2011 WINNERPicture Me This Round 51 Winner!
11th September, 2008 at 19:56:08 -

What program are you using, Logiq?

If you need a simple fastloop-based gravity/movement engine that can apply to all objects, and you're using at least MMF 1.5, you could check out this:

http://www.create-games.com/download.asp?id=6764


Just copy in the bit of code, and all objects with the correct qualifier will drop to the ground.

'Course, it does need a bit of tuning up... I should really get around to that.


EDIT - Okay, I just updated it. It now supports walking down slopes (of up to 45°) without bouncing, and includes a simple built-in collision box.

Image Edited by the Author.

 
Go Moon!

Logiq



Registered
  09/04/2007
Points
  120
11th September, 2008 at 20:50:38 -

I am using MMF2.

 
Hello guys! I'm New! -- I've been new for a year now...haha

Fifth

Quadruped

Registered
  07/05/2003
Points
  5815

VIP MemberGOTW JULY 2010 WINNER!Kliktober Special Award TagGOTW HALLOWEEN 2011 WINNERPicture Me This Round 51 Winner!
12th September, 2008 at 01:37:53 -

Here, you can give this a try:

http://www.geocities.com/f4fth/easy-movement-b.zip

I don't know if you're familiar with qualifiers, but I use 'em for pretty much everything.
This file is the above movement with the addition of two more qualifiers: Group.Traps, which makes an object into a solid obstacle, and Group.Player, which lets an object collide with said obstacles. This way, a box can become something solid, and everything else can collide against it.

It's a simple solution, and doesn't support things like rideable or moving platforms, stacking objects, or objects that can push you around. But if you copy the necessary chunk of code into a game, it'll work well enough.

I've also included a couple o' lines that let the player push the block objects.

Image Edited by the Author.

 
Go Moon!

Jon C-B

I create vaporware

Registered
  23/04/2008
Points
  237

I'm an alien!VIP MemberWii OwnerI donated an open source project Santa Hat
12th September, 2008 at 01:42:18 -


Originally Posted by -Finn-
hi well this is easy with PMO.

put another PMO and the object you want to push. Give it a name like Active 2. Set your char's name for example "Active".

Always>PMO2, set object to "Active 2"

PMO1, test for obstacle overlap
+Active collides with Active 2 >PMO1, object does overlap with an obstacle

PMO2, test for obstacle overlap
+Active 2 collides with the background >PMO2, object does overlap with an obstacle

Collision between Active and Active 2
+Active is facing right >PMO2, user is holding right key

Collision between Active and Active 2
+Active is facing left >PMO2, user is holding left key


Well, this should help you. Your Active 2 will move slowly, just increase the X Velocity for the PMO2 for moving the obstacle faster. If you want to make more objects, you will need more PMO's. A PMO per object.

have a nice day!


Image Edited by the Author.


It doesn't work....

 
n/a

-Finn-



Registered
  28/08/2008
Points
  445
12th September, 2008 at 05:57:36 -

odd jhonny cuz i just made that in MMF2

 
Image

Jon C-B

I create vaporware

Registered
  23/04/2008
Points
  237

I'm an alien!VIP MemberWii OwnerI donated an open source project Santa Hat
13th September, 2008 at 00:58:43 -


Originally Posted by -Finn-
odd jhonny cuz i just made that in MMF2


Could you post a mmf2 doc on here so I can see what I did wrong then?

P.S. JON!

 
n/a

Jon C-B

I create vaporware

Registered
  23/04/2008
Points
  237

I'm an alien!VIP MemberWii OwnerI donated an open source project Santa Hat
13th September, 2008 at 02:44:46 -

oh I found a way to do it:

Make detectors on both sides of the active that you control. Block overlaps right detector right input key an dthe other directions for left.

 
n/a
   

Post Reply



 



Advertisement

Worth A Click