A first attempt with BMax - Feedback Appreciated
BlitzMax Forums/BlitzMax Beginners Area/A first attempt with BMax - Feedback Appreciated
| ||
Well this is pretty much the first working program I've attempted since perhaps my TI-99/4a basic days, or something else similar long ago. It's a little simulation of radioactive atoms decaying (this was just the first idea I came up with at the weekend), which draws a graph as the decay occurs. I'd consider it a work in progress, i've plenty of ideas for extra stuff to add, but i'd really appreciate any constructive comments regarding my code. e.g. Is it as poor as I expect? What could I improve in it? In which ways would my code be considered bad practice? etc... (I really have not grasped OOP concepts, and made no attempt to use them here). If anybody is willing to take a look through my work and/or try it out then your feedback would be appreciated. Here goes.... See Below Note: I notice that pressing space to reset the atoms/graph after it has run through doesn't always work first time, I'm sure this is something simple if anybody could point that out too! Thanks. |
| ||
Sorry for the incorrect use of the code tags again :-\ One day i'll get them right, this time i remembered to use lowercase, but used the wrong brackets i guess... |
| ||
Please ignore this post, My posting became a comedy of errors... and I only just noticed the 'edit' option... |
| ||
for long sources replace [ code ] with [ codebox ] |
| ||
Not sure about 'BlitzMax Beginners Area', i need a 'BlitzMax Forum Beginners Area' to hone my posting skills ;) Here goes for the third time, hopefully with a codebox, a couple more comments and better formatting, preview post was a good idea this time too... Anyway, thanks for bearing with me, any comments (about my code, rather than my lack of forum skill) would still be appreciated :) |
| ||
A couple of things I've noticed: The following is unnecessary since you are already checking for KEY_ESCAPE in your while loop If KeyHit(KEY_ESCAPE) FlushMem End EndIf You're not using flushmem in your main loop, this will cause slowdown and a memory leak. (flushmem has scope) |
| ||
Perturbio: Thanks for replying.... I added the extra check for KEY_ESCAPE in the for-next loop whilst drawing the graph 'cause on my laptop it runs slowly and the check in the while loop only lets you exit once the graph is drawn. Also flushmem is in the drawscreen function, which is part of the main loop. What do you mean 'flushmem has scope'? |
| ||
http://www.blitzwiki.org/index.php/FlushMem |
| ||
Excellent, thank you... thats a real help and explains a problem I had with an earlier iteration of the program that quickly used several 100meg for no reason I could work out... Cheers :) |