The Daily Click ::. Forums ::. Klik Coding Help ::. Pushing Blocks for platform game
 

Post Reply  Post Oekaki 
 

Posted By Message

-Liam-

Cake Addict

Registered
  06/12/2008
Points
  556

Wii OwnerIt's-a me, Mario!Hero of TimeStrawberry
25th October, 2012 at 25/10/2012 19:38:10 -

Hello *again* peeps!

I've been messing around with the pinball movement for pushing a block, it didn't work out. So then I tried using a secondary PMO and I've almost got it working how I want, but... I've just realised that it only works for the first block I placed into the frame. Any others (they are the same object) just don't react to being pushed around. I'm guessing the PMO will only control the first instance of an object you place into the level then?

Any other ideas I could use for block pushing? Thanks!

Edited by -Liam-

 
Image

Tell 'em Babs is 'ere...

Chloe Sagal

under the influence of FUN

Registered
  19/02/2009
Points
  607

Orange
25th October, 2012 at 25/10/2012 21:08:13 -

Ah you've come across the dreaded MMF2 Object selection.

Welcome to the forums!

Well the easiest way I can think of is if

Player is touching block
Players X position is less than the position of the block
Players Y position is less than the players position being on top of the block
Player is holding Right
-Set blocks position it's position + whateva

And the opposite for the Left side.

If that doesn't work, you can try going back to another method, but with the PMO you might need some object selection code, otherwise it will only pick the first one (since while you think it might be specific enough, consider MMF2 to be a simpleton that doesn't understand simple orders, you need to be more specific)

For further reading on object selection,
http://www.create-games.com/article.asp?id=1975
http://www.create-games.com/article.asp?id=2248

Did you ever get your animations to work properly? You should totally create a project page for this. Not that anyone even looks at them anymore, but it does help keep you focused.

Edited by Chloe Sagal

 
Patreon: http://www.patreon.com/chloesagal
Twitter: https://twitter.com/ChloeSagal

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1970

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
25th October, 2012 at 25/10/2012 22:30:04 -

Personally, I'm not a fan of the PMO extension - I don't think it really does anything that you couldn't code yourself quite easily.
As for the blocks, it depends on what you need exactly. If you want multiple blocks that can be stacked on top of one another etc, then things start to get *very* complicated. You may even need to use one of the physics extensions (eg. Box2d). If movement is grid-based, that makes things much easier (block-pushing games usually are grid-based) - a very simple custom movement would suffice.

 
n/a

nivram



Registered
  20/07/2006
Points
  171
26th October, 2012 at 26/10/2012 00:13:16 -

Check out this PMO example on my website:

Block Stack Platformer Example - Nostalgia
Author: Frateroshi Nitorachi
Genre: Example
Extensions Needed: Platform Movement Object (PMO)
Description:
A really great example. Maybe this example could be your next block game engine. From an old cca file with an unknown date.
Instructions:
On screen.

Link:
http://castles-of-britain.com/blockstackplatformerexample.mfa

Marv

 
458 MMF2 & CTF 2.5 examples and games

http://www.castles-of-britain.com/mmf2examples.htm

Chloe Sagal

under the influence of FUN

Registered
  19/02/2009
Points
  607

Orange
26th October, 2012 at 26/10/2012 00:46:31 -

That example is unbelievably adorable! the only thing it could use is a kitten or a puppy.

 
Patreon: http://www.patreon.com/chloesagal
Twitter: https://twitter.com/ChloeSagal

-Liam-

Cake Addict

Registered
  06/12/2008
Points
  556

Wii OwnerIt's-a me, Mario!Hero of TimeStrawberry
26th October, 2012 at 26/10/2012 14:02:52 -

@Chloe I did get those animations sorted! Thanks! After looking at your method I'd say it is better than what I had down, although I've just added "particular animation is not playing" a few times on other events. It's a bit messy this way but I've already got a big messy list of events. I'll come back to that thread next time I'm making a PMO game from scratch! As for this thread, I'll give your example a try!

@Sketchy I'm not really going for anything too complex with the block pushing. Just left and right movement, preferably with gravity.

@Nivram Thanks for linking that, I've just downloaded it and will take a look when I get on Windows later on!

 
Image

Tell 'em Babs is 'ere...
   

Post Reply



 



Advertisement

Worth A Click