Everything's a mess.
BlitzMax Forums/BlitzMax Beginners Area/Everything's a mess.
| ||
fixed :D |
| ||
x = Rnd(1,640) y = Rnd(1,480) this looks wrong (always use superstrict - it helps find stuff like this) i think it should be : newgrass.x = Rnd(1,640) newgrass.y = Rnd(1,480) DrawImage newgrass.image,newgrass.x,newgrass.y Method UpdateGrass() You should probally make this a function too. Check out the tutorials about types n stuff in the tutorials section - there is a great one about someware... ... here edit: also if ur gonna do it this way - MAKE sure you remove it from the list once its been drawn otherwise ur gonna have all kinds of problems. |
| ||
Great, it's working now :D Well, most of it. I can't get the grass to stay where it was originally put. That was the point of the UpdateGrass function (I changed it back like you suggested). Any ideas? |
| ||
UpdateGrass is never called in your example so only the new PlantRandomGrass grass is drawn. You're using keydown(KEY_G) which might be stacked and calling PlantRandomGrass more times than you expected. You could change it to Keyhit. |
| ||
Wow, forgot to put that back in. It works perfectly now :D Thanks so much. |