As you see i have been making some modifications to one of the DB tutorials, but have encountered a problem
I wan't to display "You got the health" when the user brings the circle over the "health pickup" text, but the way I have it set up you have to get it exactly on the coordinates to trigger the event or you can trigger wrongly. Is there a way to display the text if the user gets the circle in a coordinate box or something? Thanks in advance.
hide mouse
rem Set a coordinate in the middle of the screen
x=320
y=240
rem Actuvate manual sync
sync on
rem Begin main loop
do
rem Clear the screen each cycle
cls
health$ = "health pickup"
rem Show the current inkey$ and scancode value
set cursor 0,10
print "Try using ARROW KEYS, CONTROL, SPACEBAR, SHIFT and RETURN"
print "Try pressing the RIGHT CONTROL KEY to flag Keystate 157"
print "Inkey$()=";inkey$();" Scancode=";scancode();" Keystate(157)=";keystate(157)
print "X = ", x, "Y = ", y
text 100,200, health$
rem Move the coordinate based on the keyboard input
if upkey()=1 then y=y-3
if downkey()=1 then y=y+4
if leftkey()=1 then x=x-4
if rightkey()=1 then x=x+4
rem make it so the circle cannot go offscreen
if y = 500 then y = y - 300
if y = 6 then y = y + 300
if x = 620 then x = x - 300
if x = 0 then x = x + 300
rem "pick" up "health"
if x + y = 350 then print "you got the health!"
rem Set the ink color based on the keyboard control keys
if controlkey()=1 then ink rgb(255,0,0),0
if shiftkey()=1 then ink rgb(0,255,0),0
if spacekey()=1 then ink rgb(0,0,255),0
if returnkey()=1 then ink rgb(64,0,64),0
if escapekey()=1 then end
rem Draw a circle at the coordinate
circle x,y,20
rem Update screen
sync
rem End the loop
loop
words to live by.... Newsgeek.tripod.com