1 decade ago by inihility
Hey folks, I'm trying to create an entity that I can move around on the game screen.
(I am not using the level editor)
So far I have only been able to render an entity through spawnEntity() if I used ig.Image and drew it in its own draw function. I would then spawn it wherever I wanted in an update function like so:
The problem it seems I am encountering right now is that I am unable to transform the entity's position via. velocity (this.vel.x/y) probably because I am drawing the image at an already specified location.
Basically I'm trying to figure out if it is possible to move an entity that renders an image with ig.Image.
(I am not using the level editor)
So far I have only been able to render an entity through spawnEntity() if I used ig.Image and drew it in its own draw function. I would then spawn it wherever I wanted in an update function like so:
update: function() { if (this.init) { ig.game.spawnEntity(EntityTitle, 0, 0); this.init = false; } this.parent(); },
The problem it seems I am encountering right now is that I am unable to transform the entity's position via. velocity (this.vel.x/y) probably because I am drawing the image at an already specified location.
Basically I'm trying to figure out if it is possible to move an entity that renders an image with ig.Image.