1 decade ago by programlocura
Hi there!
A few weeks ago i started a thread with a problem with screen scrolling, i was looking for a solution but i didn't find anything, so i came back to share my problem with you guys and you can help me :)
I'm currently applying to the player an acceleration that makes the character walk on screen ( It's a runner ). When i follow the player with the main camera, i want to make that the camera moves alone, and if the players gets stopped by something, the viewport "eats him".
My problem is that the viewport do not have an acceleration, and my character have set that he bounces against the enemy until it's dead (the enemy).
Currently doing:
var player = this.getEntitiesByType( EntityPlayer )[0];
this.screen.x = player.pos.x - (ig.system.width / 2);
On Update:
this.bounciness = 0;
On Check:
this.bounciness = 1;
Could you help me? Maybe it is a problem with the bounces against the enemy, but i don't know.
Thank you :)
A few weeks ago i started a thread with a problem with screen scrolling, i was looking for a solution but i didn't find anything, so i came back to share my problem with you guys and you can help me :)
I'm currently applying to the player an acceleration that makes the character walk on screen ( It's a runner ). When i follow the player with the main camera, i want to make that the camera moves alone, and if the players gets stopped by something, the viewport "eats him".
My problem is that the viewport do not have an acceleration, and my character have set that he bounces against the enemy until it's dead (the enemy).
Currently doing:
var player = this.getEntitiesByType( EntityPlayer )[0];
this.screen.x = player.pos.x - (ig.system.width / 2);
On Update:
this.bounciness = 0;
On Check:
this.bounciness = 1;
Could you help me? Maybe it is a problem with the bounces against the enemy, but i don't know.
Thank you :)