Hello, guys! How are you? I'm trying to create a little game similar to this one. To define the areas where the player and the enemy can move, I created the following image that I have used as an obstacle:
For movement, I use the basics: (While the K key is pressed: Change position of the object? + -XY N pixels). However, when I try to block the player's movement, the background image is ignored. The condition is also simple: (If the object 'Player' collides with 'Image': Stop the movement of 'Player'). I also tried to stop the movement when 'Player' is over the image, but with the same result. The project file is attached. Ah, taking the opportunity: the player and the enemy have a HUD. To update the HP level, I resize a rectangle that simulates the health bar. However, in the formula I used the animation is very abrupt. Maintains the same position for various values and, when reducing, reduces in large blocks, instead of reducing point by point. What would be the best formula to make the bar softer? To facilitate testing for anyone who can help, here are the game commands - and two images because ... Why not?
WASD moves the character. Aim at the enemy with your MOUSE and shoot with the LEFT BUTTON. During DEBUG, the X key increases the character's speed. Ah, all images are placeholders. Thank you in advance!