Designing a platformer engine

Game development specific discussions.
ShawnLG
Posts: 104
Joined: Dec 25, 2008 20:21

Designing a platformer engine

Postby ShawnLG » Mar 12, 2009 20:34

For the last four months, I have been designing graphics/tiles for a new platformer game called Bugyi's World. It is about a fat kid who loves to eat fatning/fast food. His goal is to travel through a series of levels and eat these food items placed through out the level. The score keeping would be the number of calories he has consumed. While on his quest, he must avoid walking fruits, vegtables and a few other obsticals. The game it's self is a parody of Super Mario World.

Now I have enough game content to start working on the engine. I have though of treating every sprite in the game as an object. Lets say a hamburger when touched by the player will give the player calories and then that hamburger object would then disappear. When the player touches a veggie charater object. The player will recive damage points from it. Other objects in the game will have other effects in the game when the player thouches them. Such as armor/health and other power ups.

Dealing with animation. I have thought of doing it seperatly in its own animation class.

If anyone has done something similar, please enlighten me on how you solved these problem.

Below is what the game may look like when it is complete.
Image
rolliebollocks
Posts: 2655
Joined: Aug 28, 2008 10:54
Location: new york

Postby rolliebollocks » Mar 12, 2009 21:46

http://www.freebasic.net/forum/viewtopic.php?t=13470

Check this out. The objects are supposed to disappear when you use them... For some reason they've decided not to...

Lachie is developing what would be a better option, but mine is about ready to go... All I'd have to do is write gravity and jump routines and voila... platform engine... It's just a really long tile map... My maps can be up to 1000x1000 tiles.

Tile size is negotiable. Rotozoom. I can make your dude get bigger when he eats more... It seems to be what you're looking for.

rb
rolliebollocks
Posts: 2655
Joined: Aug 28, 2008 10:54
Location: new york

Postby rolliebollocks » Mar 12, 2009 21:49

I just realized my engine doesn't need any new procedures to pull of a platform.

You would just set the Y friction to something larger than 0, and X friction to 0. Then you set the up arrow to move make the guys Y velocity something large...

Very simple mod...

rb
DaveUnit
Posts: 239
Joined: Apr 20, 2006 15:47
Location: Central MA
Contact:

Postby DaveUnit » Mar 13, 2009 1:50

As far as animations go. I make an animation container to hold many animations for an object in one place. animations are then made up frames which is also it's own class that contains things like tile index and time delay.
The hierarchy is like this:
AnimationContainer->Animation->Frame

Then for all the objects that use animation i give them a reference to this animation data. That way many different objects can use the same animation data and animate independently. It has worked nicely for me. It is easy to create a file format to load and save this data as well.
rolliebollocks
Posts: 2655
Joined: Aug 28, 2008 10:54
Location: new york

Postby rolliebollocks » Mar 13, 2009 11:20

I just documented the my sprite engine here: http://www.freebasic.net/forum/viewtopic.php?t=13268

It works precisely like yours, DaveUnit. And my name is also Dave.

Dave
DaveUnit
Posts: 239
Joined: Apr 20, 2006 15:47
Location: Central MA
Contact:

Postby DaveUnit » Mar 13, 2009 13:58

What a coincidence! Dave's unite!
Anywho, what would be nice about your current sprite engine is tileset support. From looking at the file format it seems that every frame has its own file. My sprites work in the sense that all the frames are going to be in one image and you simply give tile indexes to access individual frames. I suppose it's up to OP to decide what's best for him. You at least have something written and functional in fb. I only have a c++ version.
Also, does every animation in the file have to have the same number of frames? That would be a limitation.
rolliebollocks
Posts: 2655
Joined: Aug 28, 2008 10:54
Location: new york

Postby rolliebollocks » Mar 13, 2009 14:42

Also, does every animation in the file have to have the same number of frames? That would be a limitation.


No, but then I'd have to assign fb_num, ff_num, fl_num etc...

I could add that. It wouldn't be too difficult. It wouldn't slow it down either, or add much overhead. I could do it, but I haven't had a reason really.

As for a tilemap... You would have to assign a tiletype and distribute the animation individually for each type.

Also, even though # the flickers are the same, it doesn't mean the files have to be different...

So if there is a solution that doesn't requrie more overhead... I usually go that way...

I could stand to make my map better though.

rb
Alex Khan
Posts: 45
Joined: Mar 13, 2010 6:40

Postby Alex Khan » Mar 29, 2010 4:49

Can you please document how you built your 2D engine.

It is very frustrating for noobs like me to see all your great demos and have no clue where to start and how to build the engine.

Return to “Game Dev”

Who is online

Users browsing this forum: No registered users and 1 guest