I expect you know the ([property] of [sprite]) block.
Property contains stuff like x position, y position, etc. and the sprite only variables of that sprite.
However, if you create a sprite-only variable that has the same name as one of those properties, it overrides it.
For example, if you create a sprite-only variable named 'x position', and try to detect the actual x position of that sprite, you'll get the sprite-only variable instead of the value you want.
(To people who know the source code: I know why it does this. It was by looking at the source code that I found this. Please don't explain it to me.)
Offline
Interesting "feature"! My advice, if you don't want that behavior - don't name the variables like that
Offline
I found this before. Basicly its beacause of this.
direction of sprite1
The block takes the first input as a String then looks through variables. If it exists it reports that variable. If no variable is found it gets the propites of the sprite
Offline
johnnydean1 wrote:
I found this before. Basicly its beacause of this.
direction of sprite1
The block takes the first input as a String then looks through variables. If it exists it reports that variable. If no variable is found it gets the propites of the sprite
I wrote:
(To people who know the source code: I know why it does this. It was by looking at the source code that I found this. Please don't explain it to me.)
Offline