This code has been declared by its author to be Public Domain code.
Download source code | Simple Rectangle Drawing by IKG | 2006 |
| |
|
My first BlitzMax Program... |
Graphics 640,480,0
ShowMouse()
SeedRnd MilliSecs()
While Not (KeyHit(KEY_ESCAPE))
'if right mouse button is down, draw rectangle
If MouseDown(1) Then
SetColor(Rnd(1,255),Rnd(1,255),Rnd(1,255))
DrawRect(MouseX(),MouseY(),10,10)
EndIf
'press spacebar to clear screen
If KeyHit(KEY_SPACE) Then Cls()
Flip()
Wend |
Comments |
...And why would this is useful to other people?
|
|
It obviously isn't.. I mentioned code-archives-abuse before in some topic somewhere. The CA should be for useful ready-made and fully tested code, extending functionality, preferably as modular as modular can be. Also one who submits has to be convinced that the posted code is actually a real addition that ppl didn't have yet. A real solution to a possible potential problem, so to say.. Some CA-QA would be at place I'd say..
|
|
Well then get it deleted :|
I really don't care. It was helpful to me, so I added it. There's not nearly enough beginner source code out there. Where does it say this area is only for advanced coders such as you two?
But like I said, get it deleted since I can't do anything about it now. I'm sorry I don't read every post on the forums.
|
|
Beginner-code is better showcased inside a beginner tutorial, in the tutorial section of the specific blitzversion ofcourse.
CA is not advanced or for 'big code' perse; some small functions like 'Sector' (to read char-seperated parts of a string) are extremely handy, and are not present in blitz by default. That's what the CA is here for.
So, it's not as if your code is bad in itself, it would make a good beginner-tutorial.. it's just not for the CA. :)
|
|
So can a moderator please delete this?
|
|
I Like it ;-)..
a perfect sample code to show someone how easy it can be to develop a programm in BMax.
|
|
Thanks adba, that was the point of this :)
|
Code Archives Forum