Random Game Experiments

gbstyle

This first screenshot is of a super-super-prototype game I made when me and a friend decided to try and make a gameboy style (4 colors and 160×144 resolution) game in under one day. We ended up spending about 2 hours, perhaps, on the entire thing before getting bored. And that’s the result of those 2 hours. Anyways,Ā  I did compose a jaunty little bg song for the game here

A bit after that, I fooled around with platformer physics. Pretty tough stuff for a newbie in programming, but I did get a semi-working proto going. Don’t ask about that weird pseudo-3D background thing. I was running on no sleep last night and just put that in there šŸ˜‰

platrandomscreen

The code for the collision detection is rather horrible, but I haven’t found a better way to do it, nor any good tutorials that explain it in depth, so I resorted to this monstrosity.

As you can see, all it does is merely calculate if, horizontally or vertically, after moving the sphere will be inside a grid space. Sadly, the cube still will overlap on corner and occasionally be 1/3 inside a box left or right. This is because *most* of the sphere is in the legitimate space, whereas the rest is inside a bad spot. Since it uses Math.round() this happens. But as I was saying, I still haven’t found a better way yet šŸ™‚

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s