|
Post by Azan on Jun 10, 2005 21:46:55 GMT -5
Ok this is for all those people who are new to blitz, this is so that you may tackle a real challenge and see if you have trouble with it, if you do thats great because then you can get help and learn from your mistakes, its the best way to learn blitz.
Ok heres what you need to make, just a simple program where a 2d circle follows the mouse pointer, this doesnt require types or anything so its fairly simple.
Hints: Use MouseX() and MouseY() to get the coordinates of your pointer, use < and > signs to do direction checks.
When you are done post it here.
|
|
|
Post by Umbrafire on Jun 11, 2005 13:43:09 GMT -5
i assume im not allowed to participate? ;D
|
|
|
Post by Azan on Jun 12, 2005 10:46:27 GMT -5
Nope new people only
|
|
|
Post by Qecbum on Aug 16, 2005 16:54:38 GMT -5
ok hows this?
Graphics 640,480
SetBuffer BackBuffer()
Repeat Cls
Text 320,0,"Click to reset mouse",True
Text 0,0,"Mouse X:"+MouseX() Text 0,10,"Mouse Y:"+MouseY()
If MouseDown(1) Or MouseDown(2) Then MoveMouse 320,240
Text MouseX(),MouseY(),"O",True,True
Flip
Until KeyHit(1)
End
|
|
|
Post by Azan on Aug 16, 2005 19:26:50 GMT -5
Excellent, however you dont need the reset mouse part (but hey its an addon thats good). You got the challenge almost right, but a circle has to follow the mouse. But its close enough, heres your same program only with the circle following the mouse Graphics 640,480
SetBuffer BackBuffer() x=50 y=50 Repeat Cls
Text 320,0,"Click to reset mouse",True
Text 0,0,"Mouse X:"+MouseX() Text 0,10,"Mouse Y:"+MouseY()
If MouseDown(1) Or MouseDown(2) Then MoveMouse 320,240
Text x,y,"O" If x<MouseX() Then x=x+1 EndIf If x>MouseX() Then x=x-1 EndIf If y<MouseY() Then y=y+1 EndIf If y>MouseY() Then y=y-1 EndIf
Flip
Until KeyHit(1)
End
|
|
|
Post by Umbrafire on Aug 16, 2005 22:48:48 GMT -5
umm, why not just replace
Text x,y,"O"
with
Text MouseX(),MouseY(),"O"
and then that makes the whole program a LOT simpler
|
|
|
Post by Azan on Aug 17, 2005 10:53:34 GMT -5
B/C it was supposed to follow the mouse, not be at the mouses coordinates, as said above. SpikeSpiegel did it the mousex(),mousey() way which is good, but it wasnt exact to the challenge.
|
|
|
Post by Umbrafire on Aug 28, 2005 0:44:33 GMT -5
OHHH....that makes more sense lol
|
|
|
Post by Azan on Aug 28, 2005 11:45:19 GMT -5
BTW Jiub, you can set the blitz challenges, lets say once per week or something?
|
|
|
Post by Umbrafire on Aug 28, 2005 13:14:51 GMT -5
sure, i'll try to do it soon, I cant guarantee anything though
|
|
|
Post by Azan on Aug 28, 2005 13:16:13 GMT -5
Meh its not like anyone will actualy attempt it. (we need more programmers to post here, and that means you too Lobstrosity
|
|