The Daily Click ::. Downloads ::. Engine ::. Super Mario Galaxy-esque Platform Engine!
 

Super Mario Galaxy-esque Platform Engine!
Author: Pixelthief Submitted: 8th November, 2007 Favourites:0
Genre: Engine Downloads: 1046
Rated:
85th Place     (4.33 / 5)
Game of the Week Winner


Mind this is not open sourced right now, because
A) The code is uncommented and sloppy (something I can rectify)
B) Phizzy is still banned.


This is my platform engine in the style of the upcoming Mario game; Super Mario Galaxy, based on the idea of having small planetoids with their own gravity and such, allowing for the character to walk on all sorts of different edges, at any angle. This, of course, is a 2d version of that. And since the game has not actually been released in the US so far, I based this just off of what I've seen of screen shots and such.

It should be pretty easy to figure out.

Arrow keys: Move
Shift: Jump

Review This Download



 


http://claniraq.googlepages.com/SuperPixelGalaxy.zip (323 kb )



This download contains more than 50 comments, so only the latest 50 have been shown, click here to view all comments (54)
Posted by CsaR 9th November, 2007

Cool engine. Yeah the jumping varies the longer you keep jumping on the same spot but very cool nonetheless.
 
Posted by Hempuli 9th November, 2007
Rated :

Woah, the galaxy threw me to the end of the universe
 
Posted by Aptennap 9th November, 2007

Awesome
 
Posted by Klikmaster 9th November, 2007
Rated :

Haha that was really cool. Especially when you orbit
 
Posted by Dr. James MD 9th November, 2007

It's very buggy, unusable for a game in its current state. But I take it this is a beta?
 
Posted by Pixelthief 9th November, 2007

Its something I threw together in an hour; I have no plans of making a game with it. It was just a demonstration of how the gravity effects in SMG work. The main bugs you will encounter here are getting stuck in some of the backdrop worlds; the reason for this is they are simple google searches for "planet", and I had to go through and manually try to make them round. However, some of them still have random black pixels sticking out of the perimeter, which screws it up.
 
Posted by Pixelthief 9th November, 2007

Oh yeah, if you found any other bugs then just the jumping/getting stuck in planets, do tell. Those are just things I implemented in 10 seconds at the end; the actually gravity/platform movement should be fairly flawless.
 
Posted by Hempuli 9th November, 2007
Rated :

It truly is. The only bugs I found were just about getting stuck in some slopes. Also in those that looked totally round (like the grey ones)
 
Posted by Pixelthief 9th November, 2007

It can really only handle perfect circles, straight platforms, squares, and triangles. And other smooth curves. But fuzzy surfaces gave alot of problems.

For those that are interested, the formula is pretty simple; it cycles through every single "gravity well", and adds an acceleration to the players current velocity. Each object has its own Force, F, which is then gives the acceleration as:

F = A / D^2.
-for every X pixels you travel, the force of each point halves on you. Hence that giant black hole in the top right that has a force of something like 50x that of the planetoids, doesn't pull you in so much, because its so far away.

The real key is those straight brick platforms; what they actually do is have a gravity well just like the planets, except it follows you along a planar image of your position inside the platform. So as long as you are running along it, the gravity is always dominant directly at your feet. That way, I can actually create platforms at ANY angle, not just horizontal/vertical. I just did those 2 because its alot easier to image cartesian coordinates onto X and Y then it is onto a 30 degree angle or something. Ya rly
 
Posted by Dr. James MD 9th November, 2007

Wildly variable jumping heights and on some planets if you jump on the spot you get moved along.
 
Posted by Pixelthief 9th November, 2007

The "getting moved along thing" is because of gravity from other planets >.>
 
Posted by Dr. James MD 9th November, 2007

For gameplay reasons you should probably only have 1 gravity source affecting the player at a time.
 
Posted by Raverider 10th November, 2007
Rated :

Wow, pretty awesome. Could have been a little faster though.
 
Posted by -Liam- 10th November, 2007

Awesome! One fault I found was the warp thingy? That flashing bar thing. When going in there I can't seem to get out of the one it takes me to without getting taken back to the previous one. Hope that makes sence. :S
 
Posted by Billiam 10th November, 2007

I had that problem too.
 
Posted by Pixelthief 10th November, 2007

oh yeah, that was just something i slapped in at the last minute so u could go from those 2 planets easier.
 
Posted by -Nick- 11th November, 2007

That was well fun =D
 
Posted by Guru Rinpoche 11th November, 2007
Rated :

Groovy. That black hole pretty much raped me.
 
Posted by Cazra 11th November, 2007
Rated :

lawl, Africa. Good, but I keep getting stuck when I try to walk on the Mars's.
 
Posted by Pixelthief 11th November, 2007

Yah, I probably shoulda taken the time to properly round the edges on the planets so they were more walk-able. Seems more fun then walking around large red circles, though.
 
Posted by Tim 11th November, 2007

"Mind this is not open sourced right now, because...

B) Phizzy is still banned. "

Please move on, and also - your name?! *sigh*

The engine is alright though, so well done on that point.
 
Posted by DaVince 12th November, 2007
Rated :

So this is what SMG plays like?...

AWESOME. Make a full game out of this. Like, now.
 
Posted by TOMPCpl 12th November, 2007
Rated :

It's amazing! I want a source code .
 
Posted by Ganymede Graphics 12th November, 2007
Rated :

ha ha ha... this is hilarious. this funny content music happily playing while i'm whirring through space at what looks to be a speed much past light speed, this is incredible. so i don't quite understand, was this created with the tools avaliable with tgf? whats this open resource thing? i think i need to spend some time here, i haven't been on in a while.
 
Posted by Ganymede Graphics 12th November, 2007
Rated :

ha ha ha... this is hilarious. this funny content music happily playing while i'm whirring through space at what looks to be a speed much past light speed, this is incredible. so i don't quite understand, was this created with the tools avaliable with tgf? whats this open resource thing? i think i need to spend some time here, i haven't been on in a while.
 
Posted by Pixelthief 12th November, 2007

Its some fairly simple concepts;

Every planet is just a giant backdrop object. Inside each planet, is a small invisible active object called a gravity well. Each gravity well has a certain force (its value A) that corresponds to how much mass it would have.


Then, I use a loop to iterate through every single well, and add to the players "VelocityX" and "VelocityY" according to the equation:
Velocity = Force / Distance^2

It just needs to calculate simply Sin & Cos angles to convert this "Velocity" scalar into 2 velocity vectors.

Then, it constantly adds this velocity to the players current position.

Thats it.
 
Posted by Faithtoken 13th November, 2007
Rated :

Nice! As a game its not very fullfilling, and as a tutorial not very opensource... But it is a cool demo.
 
Posted by DaVince 13th November, 2007
Rated :

Toe Fungus: open source means that the source is right available. In other words, unprotected gam/cca/mfa file so you can check out how it was made.
 
Posted by DaVince 13th November, 2007
Rated :

I remember your earth thing, Jonny. I liked it, though it WAS a bit buggy.
 
Posted by DaVince 13th November, 2007
Rated :

Image
lol
 
Posted by Pixelthief 13th November, 2007

oooh now i wonder how you accomplished THAT O_o

The game has no direct collision detection in the normal sense; instead it has simple a posteri detection- whenever the player is overlapping a backdrop, he is set to the last "good" position he was in. Hence its supposed to be impossible to get stuck in backgrounds.
 
Posted by Retired Kliker Lazarus 13th November, 2007
Rated :

Wow. That was great!

And yes, PHIZZY MUST RETURNETH AS IT SAID IN THE BIBLE.
 
Posted by mojofltr 14th November, 2007

This really is a nice start to an engine. I can imagine a really nice puzzle/platformer could be created with this engine.
 
Posted by Pixelthief 14th November, 2007

I might actually make something with this, if I wasn't so hardcore into programming my main project, gridquest, right now. Ironically, my copy of Mario Galaxy has so far been unplayed because I am too busy working on it.
 
Posted by Dave S. 17th November, 2007

Great engine 10/10! By the way... why has Phizzy been banned?
 
Posted by Sphax 17th November, 2007
Rated :

You should definitely release it as an opensource tutorial.
 
Posted by Sphax 17th November, 2007
Rated :

Tha would be great.
 
Posted by CoolDude330 17th November, 2007
Rated :

Very nice engine!
 
Posted by Pixelthief 17th November, 2007

I was planning on a polished up version that would allow for some more "free" movement, like up and down non-spherical objects. However, due to some medical emergencies in the family, I might not have the time.
 
Posted by Nick of All Trades 17th November, 2007
Rated :

Boy, am I glad I am not a giant, italian plumber?
 
Posted by alastair john jack 19th November, 2007
Rated :

I wish I could go in the black hole. n_n
 
Posted by DaVince 19th November, 2007
Rated :

"oooh now i wonder how you accomplished THAT O_o"
Actually, it happened after I jumped into the wormhole... Instead of warping around like crazy, he got stuck in a planet. Pretty weird how it happened if I read your description of the engine...
 
Posted by DaVince 20th November, 2007
Rated :

*black hole
Why did I type worm hole?
 
Posted by Justin 22nd November, 2007

Could you explain a little better on how you did this? How do you link the planetary well's alterable values to the character's alterable values?
 
Posted by Pixelthief 23rd November, 2007

Every frame of gameplay (an always command), it runs a fastloop, for an amount of loops equal to the # of gravity wells.

On the loop, it chooses one of the gravity wells at random that it hasn't chosen yet (valued as a flag). Then, it adds to the player "velocity" values, according to the formula:

X velocity = X velocity + (Well's Force (A) / Distance^2) * Cos(Angle between well & player)
Y velocity = Y velocity + (Well's Force (A) / Distance^2) * Sin(Angle between well & player)

using distance calculated via the AMath object.

then the velocities are added to the players position on each frame. Thats all there is to it.
 
Posted by Zethell 10th December, 2007
Rated :

FFS, if you do something in TGF, then send the god damn DLL's with the *.RAR!
 
Posted by Pixelthief 12th December, 2007

Yeah good point; I've made a knack of always including basically EVERYTHING you could need with an open sourced project; DLL's and extensions, but I should probably attend to the compiled ones too.
 
Posted by Lunar Games 15th December, 2007
Rated :

thats great! i managed to get on the meteor!
 
Posted by 6th January, 2008
Rated :

Very good little engine
 
Posted by MBK 23rd February, 2008
Rated :

Nice
 

 



Author

Favourite



Advertisement

Worth A Click