I don't see that, it downloads fine for me, both by left clicking the link and right clicking then selecting "Save Target As".There seems to be a download problem, the file has some ID on the front and registers as corrupt.
4171d1246351689-sprite-attributes-properties-sprite1.23.zip
When I read that I thought I had missed it in some very old version, then I read it again...Version 1.25 adds two properties to...
No, as it's a single dimension array but you could useDoes the data item in the array permit an x,y coord as one entry?
Trust meI ... have never noticed anything odd
Depends what you mean by movement. Basically if you are going to assign to X or Y then you may need to erase the sprite first as the library will now no longer know where it was and so won't erase it properly. If you are letting it move itself each tick you don't need to do it. It will be obvious if it is needed.If moving to x,y would this routine need to be called for every movement
Yes, it should be a lot faster. I'll have to think about whether such a facility could fit in the present architecture of the library.but could there be any advantage, speed wise or any other way, if a sprite had a destination property (dX,dY) such that the sprite would automatically travel toward it and upon arrival trigger an event?
This version includes such an event. However I haven't implemented the "automatically travel toward" bit, you will have to calculate and define its direction yourself.if a sprite had a destination property (dX,dY) such that the sprite would automatically travel toward it and upon arrival trigger an event?
The second Dim gives the error that SpriteData is already in the dictionary.Dim Type(x, y, z, name)Spritedata
....
Dim Spritedata(4) ' make a new array
... ' set it up
Sprite.DataArray = Spritedata() ' assign it to a Sprite
I can't see anything wrong with that code. The only way I think you can get that error is if two Dim statements for the same array are in Sub Globals, only the Type statement must be in there. If it persists you will need to post some code that shows the error so I can see the context. Look at the DataDemo.sbp in the archive which contains that same code.The second Dim gives the error that SpriteData is already in the dictionary.
Actually it's not. That makes SpriteData into a two dimensional array hence the comma in "String[,]" in the error message. The library expects a single dimension array, hence the error.I tried Dim Type(x,y)SpriteData(4) which is OK
Dim Type(x, y, z, name)Data
...
Data.x = 0
Data.y = 1
Data.z = 2
Data.name = 3
Is equivalent to
Dim Data(4)
...
x = 0: y = 1: z = 1: name = 3
Data(x) = 0
Data(y) = 1
Data(z) = 2
Data(name) = 3
Dim Type(x, y, z, name)Data(2)
...
Data(0).x = 0
Data(0).Y = 1
Data(0).z = 2
Data(.).name = 3
Is equivalent to
Dim Data(2,4)
...
x = 0: y = 1: z = 1: name = 3
Data(0,x) = 0
Data(0,y) = 1
Data(0,z) = 2
Data(0,name) = 3
spr1.Value = gw.Sprite1
Data() = spr.DataArray
sprname = Data.name ' or sprname = Data(3)
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?