limits in games
Author |
Message |
metal_hed
|
Posted: Sat Mar 13, 2004 10:40 pm Post subject: limits in games |
|
|
i built an etch-a-sketch game and u want to know how to set a limit the line can goto...like a boarder. |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Tony
|
Posted: Sat Mar 13, 2004 10:44 pm Post subject: (No subject) |
|
|
you compare current position to 0,0 and maxx,maxy to see if you're still inside the boarder or not |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
|
AsianSensation
|
Posted: Sat Mar 13, 2004 11:35 pm Post subject: (No subject) |
|
|
or you could use whatdotcolor. (I'm only filling in for dodge here ) |
|
|
|
|
|
jonos
|
Posted: Sun Mar 14, 2004 1:55 pm Post subject: (No subject) |
|
|
you can't keep the mouse in the run window in turing (at least im pretty sure), but you can make it so it doesn't draw outside of the border:
if mousex >= maxx or mousex <= 0 or mousey >= maxy or mousey <= 0 then
don't draw anything
else
let the person draw something
end if |
|
|
|
|
|
the_short1
|
Posted: Mon Mar 15, 2004 7:50 pm Post subject: (No subject) |
|
|
for whatdotcolor (since nonoen release explained)
draw a border around to outside..
drawbox (0,0,maxx,maxy,color of your choice)
then
if whatdotcolor (the position of the line) = the color above
U hit wall...
else
u can keep going
try to make that color of border something realy unique like maybe 155 or something... see my color chart HERE for full color list
http://www.compsci.ca/v2/viewtopic.php?t=3782&highlight= |
|
|
|
|
|
|
|