A simple side-scroller i managed within about 15 ~ 25 minutes a loooong time ago. It's pretty straight forward. The jump is slightly glitched, it needs to be tweaked, I look forward to updating it in the near future.
Movement = Arrow Keys
Jump = Space_bar
Update
Special thanks to Zecronious for tweaking up the src!
If the link doesn't work besure to try...
http://www.filedropper.com/sidescroller
ID:1239588
Apr 16 2013, 10:00 pm
|
|
Apr 17 2013, 12:18 pm
|
|
Fix your download link.
|
The end result of what you wrote is pretty cool but the source code could've been a lot better I think. There's lots of redundant code, inconsistent spacing, poor understanding and general lack of organization. Result I'd give 9/10 for accomplishing what you set out to make but code right now is like 2/10. (Being generous with 2/10 I think).
I don't even know where to begin on how bad this code is. No offense, but I'm just taking it for how it's written, nothing more. ----- What were you even thinking. Constant_Gravity(src); Constant_Gravity(src) ------ This code: mob Is the same as this code: mob ------ This line is really lazy and inefficient. mob/Stat(){if(!moving) icon_state = "still"} //If the src isn't moving, provide the icon_state. Delete it and put it where it's meant to be (same result): Move() ------ The default step size is the same as the world.icon_size The default icon_size is 32x32. Both of these lines don't need to be there. Just delete them. World ------ Since when does anyone tab variables? var ------ Are you serious? Either use capital letters or don't. Don't do both, that's really ugly code. Also, use full stops or don't, just don't use both. Again that's really ugly and inconsistent. //create an object ------ Whoever taught you do write this should get punched in the face. y += 1
y++ // THE SAME THING
------ Oh dear god your functions. All your functions accept a mob/user input. Basically what you're saying by that is that they'll only ever be used by mobs. Well then why the hell are they defined as global? Did you not understand what object orientated means? Delete all your functions and replace them with this (it's the same thing but less stoopid). mob |
Please look at my redo of yours.
https://dl.dropboxusercontent.com/u/17647296/ Side%20Scroller.zip Either just use this or fix yours up please, right now it's really bad. |
The src is quite old... Never knew it was that bad.... I'll go ahead and apply your fixes.
Thanks for your C&C's! |
So has this been updated? I'm thinking about checking it out. One of my biggest pet peeves though is trying to read something I had to sit and "try" to make sense of (unless I'm studying something new)
|
In response to Dariuc
|
|
Yeah should be better now.
|