My original intention was that individual sprites could be prevented from being collideable via a Boolean property. It might be that say 10 sprites should never or perhaps only under certain conditions be permitted to collide....and still have the sprite visible and doing things
s has been created as a sprite and works
s.ID="Fred" seems OK
spr1 has also been in use ok
Sub gw_collision
Spr1.value=gw.Sprite1
If spr1.ID<>"Fred" Then
spr1.Velocity=6
...
Those lines of code appear to work fine for me. Which object on which line?I get the error Object must first be created....
Thank you very much for that.I am going to rewrite collisions later today or tomorrow so I'll look at it then.
Thanks.Sub gw_collision
label3.Text=gw.Sprite1.id
label4.Text=gw.Sprite2.id
Spr1.value=Gw.sprite2
If spr1.id <> "Fred" Then
spr1.Velocity=20
End If
End Sub
Sub gw_collision
Spr1.value=Gw.Sprite1
Spr2.value=Gw.Sprite2
label3.Text=Spr1.ID
label4.Text=Spr2.ID
...
Sort of! Because there is no typing in Basic4ppc everything internally is a string.So one must always have an interim (or effectively a temp) to overcome this.
To efficiently provide an explicit z-order for individual sprites is difficult as the code needs to have high performance as it is run many times per second. However there is already an implicit z-order as sprites added later are always drawn after earlier sprites. To keep a Sprites' place in the drawing order you could use the new SpriteReplace method.add a z-order to sprites
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?