Two images with movement

Viewed 72

I am doing a personal project and now I have thought of placing two ships, one ship would have to be bouncing (ship2.png) without me controlling it and the other ship would have to handle it with the arrows on the keyboard (ship.png).

The problem is that when I want to add the image "ship2.png" it seems to be overwritten and no longer places the image "ship.png".

I have already loaded the image in the section this.loadImages = function()

The problem is in this part: object.ship = new spaceship(200, 100,object.images["ship"]); if I add "ship2" it overwrites and no longer shows me "ship".

0 Answers
Related