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 Professional Discussion / Drawing in a game

Author
Message
Dark Basic Pro Enthusiast
12
Years of Service
User Offline
Joined: 8th Nov 2013
Location:
Posted: 26th Mar 2014 16:09
Okay, so I am making a sort of back-up game (in case I can't finish my game in time for the deadline) and I was wondering if anyone could help. So, since this is a back-up game, I am just making a quiz style game. I have many math problems, so I was wondering if I could possibly make it so they could work out the problem on screen. I was experimenting with a couple things earlier, and found this code for a etch-a sketch type thing.



I was wondering if I could make this type of code, but instead of using the arrow keys to move it, we could use the mouse. Any ideas?


Also, I am trying to implement it into this game
wattywatts
17
Years of Service
User Offline
Joined: 25th May 2009
Location: Michigan
Posted: 26th Mar 2014 16:14
tiffer
20
Years of Service
User Offline
Joined: 6th Apr 2006
Location: Scotland
Posted: 26th Mar 2014 16:19
What's going wrong with your current project? There's no point letting your hard work could go to waste.

Cwatson
Dark Basic Pro Enthusiast
12
Years of Service
User Offline
Joined: 8th Nov 2013
Location:
Posted: 27th Mar 2014 16:01
Quote: "What's going wrong with your current project? There's no point letting your hard work could go to waste.
"


I don't understand what you mean...
Dark Basic Pro Enthusiast
12
Years of Service
User Offline
Joined: 8th Nov 2013
Location:
Posted: 27th Mar 2014 16:13 Edited at: 27th Mar 2014 16:29
thank you so much @wattywatts


P.s do you know any way to make the line look like a solid line? whenever I use it it's just a bunch of dots, but when I used the arrow keys to control it, it was a straight line. any idea on how to make it more of a actual line?

Post P.s Do you have any idea to what I would have to do to implement this into my own game? I want it only in the parts where the questions are. Thanks!
wattywatts
17
Years of Service
User Offline
Joined: 25th May 2009
Location: Michigan
Posted: 27th Mar 2014 16:42
Quote: "do you know any way to make the line look like a solid line? whenever I use it it's just a bunch of dots, but when I used the arrow keys to control it, it was a straight line. any idea on how to make it more of a actual line?"

That's happening because you're moving your mouse too fast. The only way to fix it with that current code snippet would be to slow down the mouse movement while drawing, make the point into a bigger box/circle, or preferably both.

Quote: "Do you have any idea to what I would have to do to implement this into my own game? I want it only in the parts where the questions are. Thanks!"

Nope. I looked it over but your coding style looks odd to me, and I'm not good with anything concerning an array.
ShellfishGames
13
Years of Service
User Offline
Joined: 6th Feb 2013
Location:
Posted: 27th Mar 2014 18:38 Edited at: 27th Mar 2014 18:39


Just store the previous position and draw a line from there to the mouse, instead of using dot.

Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 27th Mar 2014 19:20
Quote: "The only way to fix it with that current code snippet would be to slow down the mouse movement while drawing, make the point into a bigger box/circle, or preferably both."

...

Quote: "Just store the previous position and draw a line from there to the mouse, instead of using dot."

This..

ShellfishGames
13
Years of Service
User Offline
Joined: 6th Feb 2013
Location:
Posted: 27th Mar 2014 19:41
Well, and using sync rate 0 instead of sync rate 60 will most certainly make the line a lot smoother, as it will consist of more individual points (unless your FPS rate is 60 or lower either way, but given the simplicity of the program I kind of doubt that)

Login to post a reply

Server time is: 2026-07-07 15:10:38
Your offset time is: 2026-07-07 15:10:38