Posted: Thu Jun 10, 2004 3:56 pm Post subject: help with whatdotcolour
Alright i know there are tutorials on this and yes i know bla bla bla but i can't understand it and i need some help i'm making it so when i click it makes a expanding procedure oval then goes back in... (missile command) and i need it so when the missile hits it... it destroys u know i dunno hwot o apply this... whatdotcolour to it... neone help please !!!
Sponsor Sponsor
aside
Posted: Thu Jun 10, 2004 4:01 pm Post subject: (No subject)
whatdotcolour if a funtion that will return a value of the colour somehwere on the screen. the coordinates you put in has to be less than maxx and maxy.
ex:
code:
var col, mx, my, mb:int
loop
mousewhere (mx, my, mb)
locate (1, 1)
put whatdotcolour (mx, my)
end loop
this will return the colour where the mouse is
MOUSECORD
Posted: Thu Jun 10, 2004 4:48 pm Post subject: hhh
is there a way to make it like ... lets say...
If thisline goes over this color then
score:=score+100
end if
i kno that makes nos esnes and its in like english not programming but do u see where i'm coming from....
aside
Posted: Thu Jun 10, 2004 5:27 pm Post subject: (No subject)
you need a value to draw the line in the first place right? suppose the coordinates is (x2, y2) use:
code:
if whatdotcolour (x2, y2)= (the colour you want as an integer) then
score+=100
end if
check it after each time you change the value of x2, y2
aside
Posted: Thu Jun 10, 2004 5:36 pm Post subject: (No subject)
also, if you pm dodge_tomahawk, he would love to tell you everything about whatdotcolour and every other thing that you don't need to know.
MOUSECORD
Posted: Thu Jun 10, 2004 6:02 pm Post subject: (No subject)
I want to make it so when i click a oval expands then implodes... back to 0 in a procedure... got ne ideas... without using a loop...
aside
Posted: Thu Jun 10, 2004 6:05 pm Post subject: (No subject)
you can use a for loop, and use the variable (usu. i) to determine the radii of the oval
Kamikagushi
Posted: Thu Jun 10, 2004 6:07 pm Post subject: (No subject)
~or as what mr mackenzie taught to use a boolean function~
Sponsor Sponsor
MOUSECORD
Posted: Thu Jun 10, 2004 6:08 pm Post subject: damn
this would be easier if i wasn't sucha noob eh... *over head*
aside
Posted: Thu Jun 10, 2004 6:09 pm Post subject: (No subject)
so.... what are you trying to do again?
MOUSECORD
Posted: Thu Jun 10, 2004 6:13 pm Post subject: (No subject)
this is what i have...
code:
procedure mouse
var mousex, mousey, button : int
mousewhere (mousex, mousey, button)
if button = 1 then
drawoval (mousex, mousey, 25, 25, 13)
end if
end mouse
loop
cls
mouse
delay(25)
View.Update
end loop
see how when you click it kinda just... draws a circle... well i want it go start from where u click and expand to 25... then implode back to 0... u see??? but i need it to not be in a loop because it will get trapped in it... i need it in a procedure or something you know... i have a loop at the end of my game... and i guess i could make some in a procedure then put rest in that loop... i don't know do you get what i'm saying??
aside
Posted: Thu Jun 10, 2004 6:19 pm Post subject: (No subject)
so.... ? i'm not sure about no looping part, that's not my strong point.
code:
var mousex, mousey, button : int
loop
mousewhere (mousex, mousey, button)
if button = 1 then
for i:1..25
drawoval (mousex, mousey, i, i, 13)
View.Update
delay (10)
cls
end for
for decreasing i:25..1
drawoval (mousex, mousey, i, i, 13)
View.Update
delay (10)
cls
end for
end if
end loop
MOUSECORD
Posted: Thu Jun 10, 2004 6:19 pm Post subject: (No subject)
acually nvm i think i got it dude... lol nice i made it go up but now i gotta make it go back down see look
code:
procedure mouse
var mousex, mousey, button : int
mousewhere (mousex, mousey, button)
if button = 1 then
for rad: 1..25
cls
drawoval (mousex, mousey, rad, rad, 13)
delay(25)
end for
end if
end mouse
loop
cls
mouse
delay(25)
View.Update
end loop
ne ideas....
MOUSECORD
Posted: Thu Jun 10, 2004 6:21 pm Post subject: (No subject)
nvm i got it LOL!!! OMFG I"M GOD YO
SuperGenius
Posted: Thu Jun 10, 2004 6:22 pm Post subject: (No subject)
aside has got it, you need a decreasing for loop after the first for loop.