Its Not Adding,
Author |
Message |
Pacman
|
Posted: Mon Nov 27, 2006 4:12 pm Post subject: Its Not Adding, |
|
|
Pacman scores 100 points for eating the dot, the score is displayed in the middle and it adds the points when he touches the dot, At the beginning it says Score=0 then if he touches one it goes Score=100 then if he touchs the other one the dot disappears but the score doesnt go to 200. Im working on it now, but maybe you can figure it out a bit faster, Thanks!!
code: |
color (brightred)
locate (17, 26)
put "Score=", pacscore ..
%First Dot To Be Eaten----------------------------------------------
distance_between_centres := sqrt ((gdot1x - x) ** 2 + (gdot1y - y) ** 2)
if distance_between_centres <= pacrad + greenrad then
if green1 = 1 then
pacscore := pacscore + 100
end if
drawfilloval (gdot1x, gdot1y, greenrad, greenrad, black)
green1 := 0
end if
%Second Dot To Be Eaten
distance_between_centres := sqrt ((gdot2x - x) ** 2 + (gdot2y - y) ** 2)
if distance_between_centres <= pacrad + greenrad then
if green1 = 1 then
pacscore := pacscore + 100
end if
drawfilloval (gdot2x, gdot2y, greenrad, greenrad, black)
green1 := 0
end if
|
|
|
|
|
|
|
Sponsor Sponsor
|
|
|
Pacman
|
Posted: Mon Nov 27, 2006 4:18 pm Post subject: (No subject) |
|
|
NVM, 10 seconds later i got it, green1 had to be green2 for the second one
THANKS!!! |
|
|
|
|
|
|
|