Everything's a mess.

BlitzMax Forums/BlitzMax Beginners Area/Everything's a mess.

IKG(Posted 2006) [#1]
fixed :D


Diablo(Posted 2006) [#2]
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.


IKG(Posted 2006) [#3]
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?


tonyg(Posted 2006) [#4]
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.


IKG(Posted 2006) [#5]
Wow, forgot to put that back in. It works perfectly now :D

Thanks so much.