-
-
Notifications
You must be signed in to change notification settings - Fork 642
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem with Renderables #267
Comments
Hi!
The big thing that changed after 24/07 was the addition of ObjectContainer (#59). But it doesn't really explain why that would break code that seems to work before. Could you share the "broken" source? I can have a look to see which code is at fault. Thanks! |
Hi Jay About the itens 1 and 2, the code below is in the end of update() method: if ((this.vel.x !== 0) || (this.vel.y !== 0)) { And now it's: this.parent(); And works! The big question is because that coming back to version 0.9.9 of 24/07 the problems disappear? I did not change anything in the code, only the version of the engine. About the item 3, I have used the last 0.9.9 version of 25/08, including the last version of debugPanel plugin and the error is gone! Anyway thanks again and sorry for the inconvenience :( |
Hi
Some issues I have detected with lastest 0.9.9 version (25/08):
When running the code (in entity update) this.renderable.angle += 0.01; if the entity is in contact with some collision map (for example, one tile with type "solid" in Tiled), the entity is not rotated. If the same code is run without the entity is in contact with some collision, the same works.
In the code:
init:
this.renderable = game.texture.createAnimationFromName([ "texture1.png", "texture2.png", "texture3.png"]);
this.renderable.addAnimation ("walk", [0, 1]);
this.renderable.addAnimation ("crouch", [2]);
update:
if (me.input.isKeyPressed("crouch"))
this.renderable.setCurrentAnimation("crouch");
else
if (me.input.isKeyPressed("left")) {
this.renderable.setCurrentAnimation("walk");
this.flipX(true);
this.vel.x = -this.accel.x * me.timer.tick;
} else
if (me.input.isKeyPressed("right")) {
this.renderable.setCurrentAnimation("walk");
this.flipX(false);
this.vel.x = this.accel.x * me.timer.tick;
}
else
this.vel.x = 0;
If I press an arrow key and then the "crouch" key, the crouch animation is displayed. if I am stopped and press straight down the crouch key, the animation is not executed.
Very Important: the issues above not exist with version 0.9.9 of the day 24/07 I was using. If I return to the other version, they disappear.
Thanks!
The text was updated successfully, but these errors were encountered: