Hi guys,
I have a problem when I try to create multiple sprites with specific images and size ( tried the search option on the forum but didn't quite find the answers I was seeking for . also searched in the Manual but the same issue appeared )
This is one of my generation codes
for turnuri=1 to 100
createsprite(turnuri,1)
inaltime_cladire = random(15,50)
setspritesize(turnuri,5,inaltime_cladire)
SetSpriteColor(turnuri,random(150,255),random(150,255),random(150,255),255)
SetSpritePosition(turnuri,random(inceput_creeare_claridi,distanta_joc_totala-final_creeare_claridi),90-inaltime_cladire)
setspritephysicson(turnuri,1)
next turnuri
( turnuri = towers in another language )
And this code
canistre = 0
numar_canistre = 20
while canistre < numar_canistre
canistra = createsprite(200)
SetSpriteSize(canistra,3,3)
//SetSpriteImage(canistra, 200 )
unde_sa_fie = distanta_joc_totala / numar_canistre
canistra_pusa = unde_sa_fie * canistre
if canistra_pusa = 0
canistra_pusa = 30
endif
SetSpritePosition(canistra,canistra_pusa, 20 )
SetSpritePhysicsOn(canistra,2)
if GetPhysicsCollision ( canistra , turnuri) = 1
SetSpritePhysicsOff(canistra)
endif
inc canistre
endwhile
canistra = gas cans in another language
The questions are :
1) How do I know what ID's are using the towers and the gas cans in order to be touched by the sprite that the player will use?
2) How I can know create the gas cans on the top of the towers , usually the are randomly created and some of them are created inside the tower sprites?
I want to use the most simplest command :
if GetSpriteCollision ( player, canistra) = 1
DeleteSprite(canistra)
endif
But this one affects ONLY the last gas can...I'm guessing that the last one has the last ID so the player can touch it. But why not the rest? They are not "technically "created with the same ..ID? while canistre < numar_canistre canistra = createsprite(200)
If is needed i will provided the code translated in English.
Thank you for your time and future answers.