firstly this is not currently running on the gp2x, partly because I don't have one, partly because its programmed using irrlicht and partly because it uses600-700 meg of ram for storing a large number of quite high res sprites :lol:.
I am making a 2D platformer called "(don't) squash the penguin" the main difference between this game and most other platformers is the movement physics. pressing the left or right key causes the character to accelerate until a max speed is reached(acceleration and friction reach equilibrium), if no input is given the character slowly slows down eventually stopping. while jumping you have absolutely no control over the character, how far you jump is completely dependent on how fast you are moving when you jump i.e. jumping when stationery the character will only go strait up. the faster you are moving when jump is pressed the farther you go forwards, but the hight of the jump decreases. should you hit a wall the character will bounce off it at significantly reduced speed.
this can be sort of seen in this video
http://www.vimeo.com/919189
here is a newer video of the game, but with no movement physics
http://www.vimeo.com/1264043
problems:
----you jump way too far
----hight of the jump doesn't decrease with speed
----there are no character animations
----the character never stops moving
---- falling off a platform causes the character to fall at consent speed instead of accselorating downwards like would happen in reality.
here is the movement code for used in that video
CODE
/*
/////////////////////////////////////////////////////////////////////////////////////////////////
@FUNCTION: player acseloration
@COMMENTS: handles acseloration of the player
/////////////////////////////////////////////////////////////////////////////////////////////////
*/
vector3df player_acseloration(vector3df acseloration, int &jumping, float &jump, int floorcolide, int &wallcolide)
{
// friction
if(floorcolide == 1)
{
if(acseloration.X > 0)
acseloration.X -= .0004;
else
acseloration.X += .0004;
}
// gravaty
acseloration.Y = -0.035;
//cap player speed
if(acseloration.X > 0.02)
acseloration.X = 0.02;
if(acseloration.X < -0.02)
acseloration.X = -0.02;
// jump
if(jump > 0)
{
acseloration.Y += jump;
jump = jump - 0.0001;
}
//rebound off walls
if( wallcolide == 1)
{
acseloration.X -= (acseloration.X*2) * .7;
wallcolide = 0;
}
return acseloration;
}
/*
/////////////////////////////////////////////////////////////////////////////////////////////////
@FUNCTION: apply movement
/////////////////////////////////////////////////////////////////////////////////////////////////
*/
vector3df apply_movement(vector3df location, vector3df acseloration)
{
// apply movement to player
location.X += acseloration.X;
location.Y += acseloration.Y;
return location;
}
the main problem with this is that when you start moving and relece the controls the character slows down, but never completely stops. also the jump height remains constant no matter what speed you are traveling at.
any ideas?
I am making a 2D platformer called "(don't) squash the penguin" the main difference between this game and most other platformers is the movement physics. pressing the left or right key causes the character to accelerate until a max speed is reached(acceleration and friction reach equilibrium), if no input is given the character slowly slows down eventually stopping. while jumping you have absolutely no control over the character, how far you jump is completely dependent on how fast you are moving when you jump i.e. jumping when stationery the character will only go strait up. the faster you are moving when jump is pressed the farther you go forwards, but the hight of the jump decreases. should you hit a wall the character will bounce off it at significantly reduced speed.
this can be sort of seen in this video
http://www.vimeo.com/919189
here is a newer video of the game, but with no movement physics
http://www.vimeo.com/1264043
problems:
----you jump way too far
----hight of the jump doesn't decrease with speed
----there are no character animations
----the character never stops moving
---- falling off a platform causes the character to fall at consent speed instead of accselorating downwards like would happen in reality.
here is the movement code for used in that video
CODE
/*
/////////////////////////////////////////////////////////////////////////////////////////////////
@FUNCTION: player acseloration
@COMMENTS: handles acseloration of the player
/////////////////////////////////////////////////////////////////////////////////////////////////
*/
vector3df player_acseloration(vector3df acseloration, int &jumping, float &jump, int floorcolide, int &wallcolide)
{
// friction
if(floorcolide == 1)
{
if(acseloration.X > 0)
acseloration.X -= .0004;
else
acseloration.X += .0004;
}
// gravaty
acseloration.Y = -0.035;
//cap player speed
if(acseloration.X > 0.02)
acseloration.X = 0.02;
if(acseloration.X < -0.02)
acseloration.X = -0.02;
// jump
if(jump > 0)
{
acseloration.Y += jump;
jump = jump - 0.0001;
}
//rebound off walls
if( wallcolide == 1)
{
acseloration.X -= (acseloration.X*2) * .7;
wallcolide = 0;
}
return acseloration;
}
/*
/////////////////////////////////////////////////////////////////////////////////////////////////
@FUNCTION: apply movement
/////////////////////////////////////////////////////////////////////////////////////////////////
*/
vector3df apply_movement(vector3df location, vector3df acseloration)
{
// apply movement to player
location.X += acseloration.X;
location.Y += acseloration.Y;
return location;
}
the main problem with this is that when you start moving and relece the controls the character slows down, but never completely stops. also the jump height remains constant no matter what speed you are traveling at.
any ideas?