I have this game i am working on and the bullet on screen is having a small error. It shoots one bullet at a time, and when the ships y coordinates are over 200 it shoots fine. When they are under 200 it jumps and shoots from there. If anyone can check out my code or test it themselves and give me any words of advice that would be very helpful thank you. Comment out the background image and just draw the shapes if needed =) i was trying to debug this problem but it has gotten frustrating. thanks
//if the bullet is active keep going until it reaches 950 then delete it
if(bulletActive){
bulletx += 60;
if(bulletx > 950)
bulletActive = false;
}
//move then draw everything
window.draw(background);
bullet.move(bulletx, bullety);
triangle.move(movex, movey);
window.draw(triangle);
i was trying to multiply the position of the bullet and it got closer yet still not on the ship. I even tracked the position in the console and it said that the amount of pixels was the same so it should be shooting from the same position.