I am new to the forum, and programming. This I do for entertainment.
I tried to put limits on the player window, and the heart, which is the enemy off the screen, as shown in the video I posted below.
I used Video Game controller that posting Nat
I would appreciate someone guide me to add the limits.
Hello @Anak, do you mean limits to how far a sprite can go ?
Something like should work fine:
if sprite.x > WIDTH then
sprite.x = WIDTH
end
if sprite.x < 0 then
sprite.x = 0
end
if sprite.y > HEIGHT then
sprite.y = HEIGHT
end
if sprite.y > 0 then
sprite.y = 0
end