Page 1 of 1

Platform Jim Example

PostPosted: Tue Aug 02, 2011 8:30 pm
by jimmynewguy
Howdy! Just was messing with stuff and felt the urge to post an example on how I do things in the world of platformers. Couple people asked how I did movement and such so this is for them/others who want to see some cool-ness.

It's got my "collision system" that's really quite...not the real way to do things. But it's my work around to stick with GE :) and the blood effect from Awesome Man. I drew everything and made them there sounds as well (the player's run animation was from a tutorial, I edited it to fit GE and colored the headless/neck-less/strange shaped man and tried my best to make him look decent). You can use anything in here as you please. Sorry for the lack of presentability. (That a word?) was thinking of this being a game, but I didn't really have any idea of what it was..so I threw in some pickups and a booby trap and posted it. Oh well :lol:

- Arrow Keys Move
- Z Jumps

Cheers!

PS: More veteran coders, don't judge my bad coding methods! :wink:

Re: Platform Jim Example

PostPosted: Tue Aug 02, 2011 11:51 pm
by Jagmaster
This is helpful for me mainly because the collisions lack the dreaded "Physical response" while still keeping the walls "slippery". I never thought of making a collision detector that looked like that either. +1 :D

Re: Platform Jim Example

PostPosted: Wed Aug 03, 2011 12:12 am
by skydereign
Well there are ways to use PhysicalResponse to maintain velocity while preventing you from falling through the ground, or sticking to a wall.
Code: Select all
double xvel = xvelocity;
PhysicalResponse(MOVE_EVENT_ACTOR_ONLY, USE_CALCULATED_MASS, 1.000000, 1.000000, 0.000000, 0.000000);
xvelocity=xvel;

Switch the xvelocity for y to handle walls.

Not going to judge your methods, just curious, can you really read that draw script?

Re: Platform Jim Example

PostPosted: Wed Aug 03, 2011 12:25 am
by jimmynewguy
Thanks Jag.

And yea sky, I can read the draw script. I have a really good memory so I know where I put things and when :) probably doesn't help others that I do things that way though...

Re: Platform Jim Example

PostPosted: Wed Aug 03, 2011 12:27 am
by Jagmaster
This is actually what I've been using for one of my newer projects (not Hrt) I read Dst's perfect collision demo. It doesn't work with ramps or curves real well though, so I've had to make a separate actor for slopes, ramps, ect.

Actually, I didn't even read the draw script. I was looking at collision events. I probably should have though. I have yet to learn more about Collisionfree and stuff like that, so I can have an entire script for a player in draw actor. I have also yet to understand Gag's collision system too (which, works awesomely well with slopes).

Edit: who were you talking to regarding draw actor Sky?

Re: Platform Jim Example

PostPosted: Wed Aug 03, 2011 12:33 am
by skydereign
I was asking jimmynewguy, as the code looks (to me) unnecessarily dense, to the point that there are bits of code not directly viewable in the editor. But it seems jimmynewguy remembers the code, instead of going back and reading it, which works in the short run. Writing like that for me would take some serious effort, but to each his own.

Re: Platform Jim Example

PostPosted: Wed Aug 03, 2011 7:45 pm
by Camper1995
Jimmy, man, from now, I will use your collisions in every platformer I will make. Thank you so much.

Great, I really appreciate this!

+1 for you sir :D