Author
Topic: free pascal graphic program help (Read 1526 times)

Hello everyone, I have sort of a problem. I am student of technical school and for our finish exam in programming we got make a game. So games are not hard to make, but I got real confused. I need to make a person who is running and picking apples, but there are some type of ghosts or animals. When the character picks apples, the energy increases and when ghost catches him it loses energy. Here is the code since where I encountered error and then I will explain the problem:

Energy is not yet functional, but the problem is with apples. Draw3 draws a black apple (not visible on the screen), draw2 draws a green apple. So when I move the character arround draw2 draws green apple. When I put my character over the draw3 (x and y are coordinates of character; x1 and y1 are coordinates of apple) apple should disappear, but it is not happening.

Can anyone help me? If you help me with this code, please, write your own or just give me some suggestion. Thanks!

I think you may be doing something wrong in draw/draw2/draw3. When your player eats an apple, you must change x1, y1 (i.e. x1:=-1, y1:=-1, where -1 means no apple, or maybe change the apple's coordinates to move it to another place). But we don't know what are you doing in draw/draw2/draw3.