Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Simple, yet I don't know it

Author
Message
Jigga
21
Years of Service
User Offline
Joined: 13th Nov 2002
Location:
Posted: 14th Nov 2002 04:33
Yes, I am very new to Dark Basic. I want to make a very simple program that shows a filled red circle in the center of the screen. Every time the player clicks on the circle, with the mouse, he gets a point. The players points and name are shown on the screen also. I know the input name$ part of the code, but all the other part of the code I do not know. Can you please help me out. Remember, I am very very new to this.
Shadow Robert
21
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 14th Nov 2002 06:46
I'm not sure i follow you want the program to do
do you want the Red Circle to just be a button, or do you need points plotted in the circle on clicking?
(^_^) might be easier to help if you explain in a little more detail what your after

Anata aru kowagaru no watashi!
jomo
21
Years of Service
User Offline
Joined: 31st Oct 2002
Location: Ireland
Posted: 15th Nov 2002 14:50
i think i know what your trying to do...
lets say the circular button is located at (320,240)
that circle has a radius = r

if the mouse is inside the circle then

(mousex - 320)^2 + (mousey - 240)^2 <= R^2
this is quation for any circle

in code you'd have something like this

if mouseclick() = 1
if (mousex() - 320)^2 + (mousey()-240)^2 <= R^2
point = point + 1
endif
endif

the ^2 means square whats inside the brackets

im not to sure about the filled red circle

hope this is of some help
slan
jomo

Login to post a reply

Server time is: 2024-04-25 11:31:59
Your offset time is: 2024-04-25 11:31:59