
-----------------------------------
MOUSECORD
Thu Jun 10, 2004 10:16 pm

Mousecommand help
-----------------------------------
okay i'm making this program (missile command) and where when you click with your mouse it explodes and implodes you know missile command right well when i do it.... it dosn't stay in one spot... meaning if i move the mouse it follows it around and you ahve to hold the mouse click down does anyone know how to stop this from happening... (no loops or for loops, only if statements)[/code]

-----------------------------------
aside
Fri Jun 11, 2004 6:51 am


-----------------------------------
you were checking the mouse value constantly, and in your program, the centre of the explosion is the mouse value, so it will change as the mouse goes. so set another pair of variables to hold the original mouse value.

-----------------------------------
MOUSECORD
Fri Jun 11, 2004 8:28 am


-----------------------------------
okay yeah i see where you are coming from how do u go about doing this?

-----------------------------------
MOUSECORD
Fri Jun 11, 2004 8:43 am


-----------------------------------
i still need help with whatdotcolor lol

-----------------------------------
aside
Fri Jun 11, 2004 11:48 am


-----------------------------------
add this to the program:


var cex, cey:int


 then change if button is clicking


mousewhere (mousex, mousey, button)
if button=1 then
cex:=mousex
cey:=mousey
end if

then change the drawing part


drawfilloval (cex, cey, .....)




-----------------------------------
MOUSECORD
Fri Jun 11, 2004 1:00 pm


-----------------------------------
yeup thx i got it now all i gotta do if make it so when the white of the missile hits the red of the anti missile the missile ends got ne insite?

-----------------------------------
aside
Fri Jun 11, 2004 4:10 pm


-----------------------------------
assume that you already have the variables of the positions of the missile and anti-missile. check whatdotcolour.

-----------------------------------
Jodo Yodo
Fri Jun 11, 2004 10:15 pm


-----------------------------------
If the entire missiles are coloured white and red respectively, then you shouldn't use whatdotcolour detection since it su>