Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 limits in games
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
metal_hed




PostPosted: 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
Sponsor
sponsor
Tony




PostPosted: 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
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
AsianSensation




PostPosted: Sat Mar 13, 2004 11:35 pm   Post subject: (No subject)

or you could use whatdotcolor. (I'm only filling in for dodge here Razz )
jonos




PostPosted: 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




PostPosted: 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=
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 5 Posts ]
Jump to:   


Style:  
Search: