Code archives/Algorithms/Movemouse

This code has been declared by its author to be Public Domain code.

Download source code

Movemouse by Nate the Great2008
I have changed it to a fun mouse program I have made that demonstrates how to effectively use the movemouse command.
Graphics 400,400,0,2
AppTitle "Mousefun  :)"

Global mx# = 200
Global my# = 200
Global mvx# = 0
Global mvy# = 0
Global red = 255
Global green = 255
Global blue = 0


Type sparks
	Field x#,y#,dx#,dy#,lif,r,g,b
End Type


SetBuffer BackBuffer()

While Not KeyDown(1)
Cls

mvx# = mvx# + (MouseXSpeed()/7)
mvy# = mvy# + (MouseYSpeed()/7)

mvy# = mvy# + .1


If my# > 400 Then
	mvy# = -mvy#*.7
	my# = 400
EndIf

If my# < 0 Then
	mvy# = -mvy#*.9
	my# = 0
EndIf
;
If mx# > 400 Then
	mvx# = -mvx#*.9
	mx# = 400
EndIf

If my# > 397 Then
	mvx# = mvx#*.7
EndIf

;
If mx# < 0 Then
	mvx# = -mvx#*.9
	mx# = 0
EndIf
;
;If mvy# < 2 Then mvy# = 0
;
;
mx# = mx# + mvx#
my# = my# + mvy#

MoveMouse mx,my
updatesparks()


Flip

Wend

End



Function updatesparks()

For a = 1 To 4
	s.sparks = New sparks
	s\x# = MouseX()
	s\y# = MouseY()
	s\dx# = Rnd#(-.3,.3)
	s\dy# = Rnd#(-.3,.3)
	s\r = red
	s\g = green
	s\b = blue
	s\lif = 255
Next

For s.sparks = Each sparks
	Color s\r*(s\lif/255.0),s\g*(s\lif/255.0),s\b*(s\lif/255.0)
	Plot s\x#,s\y#
	s\x# = s\x# + s\dx#
	s\y# = s\y# + s\dy#
	
	s\lif = s\lif - 2
	If s\lif <= -1 Then Delete s.sparks
Next

End Function

Comments

Azathoth2008
How do you know it accurately predicts stocks when you also say "it doesn't tell you when it is predicting the stocks"?


klepto22008
Because the possibility is high that a stock will catch up one of these values in an unknown time ;)
Sorry, but this is one of the most unneedest and useless code I've seen and definetly not worth to be in a codearchiv.


GaryV2008
Obviously, you have never seen Xylvan's posts.


Nate the Great2008
The only reason I posted this was because I used something similar in a game and thought it would be funny to apply it to real life. :)


Stevie G2008
The more the code archives gets cluttered with shite the harder it is to find the useful stuff.

Any more of this keep it to yourself!!


plash2008
I agree with klepto and Stevie. The code archives should contain useful code, not nonsense.


Nate the Great2008
sorry but it was useful to me.

How do I take it down???

Very creative using shite instead of...


Nate the Great2008
maybe I could replace it???


plash2008
sorry but it was useful to me.
Don't bet your stocks on it!

maybe I could replace it???
That would be the only non-moderatorized way to do it.


Nate the Great2008
Plash No I don't bet my stocks on it!!!??? I just used it in a game and put the data in an array for easy acces.

I have changed it :)

Tell me if this is better.


*2008
for god sake people, weve all started somewhere when programming and everything we created when we started out seemed like a brilliant program to us. Surely we shouldnt be stamping on enthusiasm so quickly yeah the program may not be what everyone wanted but to someone new to coding it could be a pointer in the right direction.


Stevie G2008
@ Edzup, clearly you didn't see the original 'Stock Predictor' program.


Code Archives Forum