Wednesday, July 28, 2010

The Physical Adventures of Thumb-Man In Sunshine Land




Woohoo! Above you will find the first fruits of my attempts at videogaming. Alright, it's modest. And the graphics are pretty rushed. And there isn't really an objective. In fact, it's really just a platformer physics engine, and even then the controls are kinda sluggish. But here's the cool part! You can click those little arrows in the upper-right corner to change the physics constants: gravity, land speed, jump speed, and the coefficients of friction in the air and on land. Just use the arrow keys to move the little dumpy thumb-guy. It's pretty self-explanatory.

AWESOME FEATURES!
  • The height of your jump depends on the duration you hold down the "up" button. Whoah, cool!
  • Real simulated physics includes a vague semblance of momentum! Ga-roovy!
  • Crouching increases your friction with the ground, sacrificing speed but increasing control. Duuuuuude!
I read somewhere that Miyamoto and his team made a level editor for Super Mario Galaxy 2 so that people on the art team could actually make levels of the game without doing any programming. I thought it might be cool to have a graphical, non-programming interface to test game mechanics and controls, which is where this miniature half-project originated. In other words, I'm lazy and want you to do my dirty work. Try tinkering with the variables and leave a message if you find a setting that feels particularly fluid. Crank air friction all the way down to .009 to give our hero Simon Belmont-esque realistic jump physics, or pump it way up to 1 to give him divine air control worthy of Jigglypuff himself!

Some technical notes of varying nerdliness:
  • Sorry about the arrow button controls. It would obviously be easier to just have a text entry field for each variable, but for some reason I didn't realize this until I had written an entire Class for the arrow buttons with a bunch of neat little bells and whistles, and now I'm too attached to it. I guess I can go back and change it if it's that bad... also, if you think one of the variables increments too much or too little with each click, message me and I'll fix the code.
  • Just to clarify, the friction values are coefficients for the character's speed, so lower number = more friction. The other values work the opposite. Bigger number = more gravity, etc.
  • Okay, this one's really nerdy: ActionScript is weird. For some reason, when I fed a global Number variable of the game's main class to an instance of the Up/Down Button class, it copied the variable's value and left the original unchanged. Okay, normal. But when I did the same with a TextField variable, it actually went and updated the original. So yeah, I'm not really sure how pointers work in this language. There is still much to learn.
Well, have fun.

nathan

    No comments:

    Post a Comment