Example: Simple Platformer Engine

Learn to use DS Game Maker by Example!

Example: Simple Platformer Engine

Postby Bobbyloujo » February 24th, 2011, 1:18 am

A fairly basic example of a platformer. The collisions are decent but not perfect. I haven't done much with DSGM lately so that's why I made this.
Attachments
Platformer Engine.nds
(311.56 KiB) Downloaded 254 times
Platformer Engine.dsgm
(2.8 KiB) Downloaded 365 times
Seriously never posting again, lawlz.
jk
Bobbyloujo
 
Posts: 1299
Joined: December 30th, 2010, 8:40 pm
Location: Uh-merica

Re: Example: Simple Platformer Engine

Postby RedLink » February 24th, 2011, 3:36 am

It´s good, but there are many things you should take a look to, for example, when you jump, you can jump again in the air. Maybe you can make it better
RedLink
 
Posts: 6
Joined: February 21st, 2011, 7:39 pm

Re: Example: Simple Platformer Engine

Postby Bobbyloujo » February 24th, 2011, 4:48 am

That's a good point. Easy fix. Within the Button Press A event, create an If statement: "If gravity == 0" then put the "Set Variable gravity to -1300" in a block after the if statement.
Last edited by Bobbyloujo on February 26th, 2011, 5:17 pm, edited 1 time in total.
Seriously never posting again, lawlz.
jk
Bobbyloujo
 
Posts: 1299
Joined: December 30th, 2010, 8:40 pm
Location: Uh-merica

Re: Example: Simple Platformer Engine

Postby cilein » February 24th, 2011, 9:31 am

@Redlink,
It's an example to get people off the ground, and for his own practice, you should try playing with it, understanding it and then expanding it yourself :P
cilein
 
Posts: 302
Joined: December 31st, 2010, 12:10 am
Location: EU

Re: Example: Simple Platformer Engine

Postby gamebox » February 24th, 2011, 10:53 am

when I got the .DSGM file and looked at the actions an error said that there was an action that I did not have that you used. :evil:
gamebox
 
Posts: 17
Joined: January 13th, 2011, 5:37 pm

Re: Example: Simple Platformer Engine

Postby RedLink » February 24th, 2011, 7:04 pm

Cilein wrote:@Redlink,
It's an example to get people off the ground, and for his own practice, you should try playing with it, understanding it and then expanding it yourself :P

I know, that was just a recommendation
RedLink
 
Posts: 6
Joined: February 21st, 2011, 7:39 pm

Re: Example: Simple Platformer Engine

Postby Bobbyloujo » February 24th, 2011, 9:51 pm

gamebox wrote:when I got the .DSGM file and looked at the actions an error said that there was an action that I did not have that you used. :evil:


My apologies. I forgot to mention that I used the "Get BG color" action that Mango made I believe. Search for it.
Seriously never posting again, lawlz.
jk
Bobbyloujo
 
Posts: 1299
Joined: December 30th, 2010, 8:40 pm
Location: Uh-merica

Re: Example: Simple Platformer Engine

Postby mangopearandapples » February 24th, 2011, 11:15 pm

Yay! You used my action! Woop!
mangopearandapples
 
Posts: 419
Joined: December 30th, 2010, 2:36 pm
Location: A place to eat.

Re: Example: Simple Platformer Engine

Postby Bobbyloujo » February 26th, 2011, 4:35 am

I've been working on this more today. Nearly perfected it. Still some small things but whatever. I might make an actual game out of this.

Go ahead and ask if you need anything explained.
Attachments
Platformer Engine.dsgm
(8.28 KiB) Downloaded 158 times
Platformer Engine.nds
(327.56 KiB) Downloaded 138 times
Seriously never posting again, lawlz.
jk
Bobbyloujo
 
Posts: 1299
Joined: December 30th, 2010, 8:40 pm
Location: Uh-merica

Re: Example: Simple Platformer Engine

Postby jace » March 5th, 2011, 5:04 pm

This is cool. I think I contributed to it as it was I that requested the action to be made xD

Only joking

It's really good. Well done.
jace
 
Posts: 91
Joined: December 31st, 2010, 12:50 pm

Re: Example: Simple Platformer Engine

Postby Bobbyloujo » March 5th, 2011, 8:35 pm

I actually made it even better. I'll upload the latest at some point. I made it so you can walk up and down hills.
Seriously never posting again, lawlz.
jk
Bobbyloujo
 
Posts: 1299
Joined: December 30th, 2010, 8:40 pm
Location: Uh-merica

Re: Example: Simple Platformer Engine

Postby jace » March 6th, 2011, 9:54 am

awsome! Please do post!! :)
jace
 
Posts: 91
Joined: December 31st, 2010, 12:50 pm

Re: Example: Simple Platformer Engine

Postby Bobbyloujo » March 25th, 2011, 9:55 pm

Alright, it's pretty much as complete as I'm gonna make it right now.

Basic rules to follow:
-He can't walk up hills with a slope steeper than 1.
-If you want the collision map to be a different layer, you have to change all of the "If BG color" actions to work with the new layer.
-There are some glitches. Clever level design and testing your levels will easily fix this.

Sorry that it's not commented very well. If you have questions, just ask.

I posted the wrong .nds file. Sorry. In the finished one, you can't walk into anything with a slope greater than 1.
Attachments
Platformer Engine.dsgm
(8.55 KiB) Downloaded 124 times
Seriously never posting again, lawlz.
jk
Bobbyloujo
 
Posts: 1299
Joined: December 30th, 2010, 8:40 pm
Location: Uh-merica

Re: Example: Simple Platformer Engine

Postby cilein » March 26th, 2011, 2:32 pm

You could have made a constant or variable to determine the collision map layer to make updating the code handy.
cilein
 
Posts: 302
Joined: December 31st, 2010, 12:10 am
Location: EU

Re: Example: Simple Platformer Engine

Postby Bobbyloujo » March 26th, 2011, 6:38 pm

Good idea. Done. Just change the global variable 'layer' to layer you want. Also fixed some other stuff. I forgot that I had the variable 'feet' for if you player's feet are always in the middle of the sprite. I had to change some stuff to fix that. There are glitches. For example, if you jump right under the tall wall thing that I put in, it'll carry you to the top of the screen. If you don't want this, don't allow the player to jump under anything tall. I was thinking though, it may be useful for something like an elevator 8-)
Attachments
Platformer Engine.nds
(330.06 KiB) Downloaded 136 times
Platformer Engine.dsgm
(8.74 KiB) Downloaded 163 times
Seriously never posting again, lawlz.
jk
Bobbyloujo
 
Posts: 1299
Joined: December 30th, 2010, 8:40 pm
Location: Uh-merica


Return to Tutorials & Examples

Who is online

Users browsing this forum: No registered users and 0 guests