Page 1 of 1

URGENT HELP!!

PostPosted: Sat Feb 20, 2010 9:33 pm
by CrimsonTheDarkBat
Hey all.
I need some help majorly!
For my latest creation, I wan't my damn ugly physics to be fixed properly.
My last game PHailed due to this issue ¬¬
Basically, when you run up a hill/slope the camera shakes madly!
AND, when you run down a hill/slope, you seem to bounce a bit.

I have the core engine enclosed as an attatchment. See it to help me!
PLEASE!

Re: URGENT HELP!!

PostPosted: Sun Feb 21, 2010 2:52 am
by Hblade
To do this, dont make the player the views parent. Instead, do this inside of Draw Actor (Assuming your resolution is 640x480)
Code: Select all
if (xscreen>328)
{
view.x+=4 //Assuming your player speed is 4 (when key down is pressed)
}
if (xscreen<313)
{
view.x-=4;
}
if (yscreen>248)
{
view.y+=4;
}
if (yscreen<233)
{
view.y-=4;
}

That should do it :D The view will only move if the player is a view pixels off from the center :3

Re: URGENT HELP!!

PostPosted: Sun Feb 21, 2010 6:12 am
by Bee-Ant
Hblade wrote:To do this, dont make the player the views parent. Instead, do this inside of Draw Actor (Assuming your resolution is 640x480)
Code: Select all
if (xscreen>328)
{
view.x+=4 //Assuming your player speed is 4 (when key down is pressed)
}
if (xscreen<313)
{
view.x-=4;
}
if (yscreen>248)
{
view.y+=4;
}
if (yscreen<233)
{
view.y-=4;
}

That should do it :D The view will only move if the player is a view pixels off from the center :3

Instead of doing this, you better do :
view-DrawActor :
Code: Select all
x=max(player.x-340,min(x,player.x-300));
y=max(player.y-340,min(y,player.y-300));

Re: URGENT HELP!!

PostPosted: Sun Feb 21, 2010 1:48 pm
by CrimsonTheDarkBat
Thanks guys, this fixed my problem :)

But, now whenever the player falls, he takes forever to hit the end of the view,
and the walls seem to defy gravity? :(

Any help regarding that peeps? :D

Re: URGENT HELP!!

PostPosted: Sun Feb 21, 2010 3:31 pm
by Hblade
Beeant, how do you learn this stuff! :D You just tought me somthin' :P

Re: URGENT HELP!!

PostPosted: Sun Feb 21, 2010 5:54 pm
by Bee-Ant
CrimsonTheDarkBat wrote:Thanks guys, this fixed my problem :)

But, now whenever the player falls, he takes forever to hit the end of the view,
and the walls seem to defy gravity? :(

Any help regarding that peeps? :D

Wall defy gravity?
May try this :
Player-Collision-Left and Right side of Wall :
Code: Select all
yvelocity++;

After you add the Physical Response.

Re: URGENT HELP!!

PostPosted: Sun Feb 21, 2010 5:56 pm
by Bee-Ant
Hblade wrote:Beeant, how do you learn this stuff?

From my anchestor :P

Re: URGENT HELP!!

PostPosted: Sun Feb 21, 2010 6:02 pm
by Hblade
xD