I am trying to put in poisonous mushrooms in my game. I have put in water melons just fine, loading the object off of anim8tor and everything. But! When I do the same thing for mushrooms it goes all haywire.
rem Fruits
NumberOfFruits = 20
FruitColor = 0
for t = 1 to NumberOfFruits
load object "C:\Users\Dania\Desktop\example\media\watermelongame.x", t + NumberOfFruits
texture object t + NumberOfFruits,8
position object t + NumberOfFruits ,Rnd(1900)-950,30,Rnd(1900)-950
make object collision box t + NumberOfFruits ,-25,-25,-25,25,25,25,0
next t
for t = 1 to NumberOfFruits : rem If I hit one of the little fruits
if Object collision(1,t + NumberOfFruits)>0
MyScore = MyScore + 100 : rem How many points each little fruit is worth
` delete object t + NumberOfFruits
exclude object on t + NumberOfFruits
endIf
next t
So, this is how I input the watermelon and make the score. Everything works perfectly fine, I did the same thing with a superfruit. But why do I get a problem when I try adding mushrooms? It constantly tells me it either already exists (which it doesnt) or the object cant be found. I cant put it in a for next loop to make 20 of them randomly like the watermelons. Does anyone know the answer?
This is the code to the mushrooms
for x = 1 to 20
load object "C:\Users\Dania\Desktop\example\media\mushroomgame.x",101
texture object 101,9
position object 101 ,Rnd(1900)-950,30,rnd(1900)-950
make object collision box 101,-25,-25,-25,-25,-25,-25,0
next x
for x = 1 to 20 :
if Object collision (1,101)>0
exclude object on 101
MyScore = MyScore - 100 : Rem How many points if you hit the poison mushroom
endif
next x