You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// p.sprs[name] = fld (has been set by loadSprite)
}
}
It offers convenience when the user need to access some sprite or sound instance. However it works only when the variable names matches the sprite or sound name.
Within the example project (Archive.zip), it is OK to declare variables like
var (
NiuXiaoQiNiuXiaoQiexplosionSound
)
While it panics if we declare variables like
var (
myNiuXiaoQiNiuXiaoQicurrentSoundSound
)
Sometimes it is fair to define some variables to hold sprite or sound instance during the game, which are for specific purpose that we do want to name them with some other names. That should not cause panic.
This issue proposes to remove the panic behavior when loadSound / loadSprite failed because of name mismatch here.
The text was updated successfully, but these errors were encountered:
spx tries to do auto-binding for sprites & sounds when the game starts running:
spx/game.go
Lines 256 to 271 in 1b3a5bf
It offers convenience when the user need to access some sprite or sound instance. However it works only when the variable names matches the sprite or sound name.
Within the example project (Archive.zip), it is OK to declare variables like
While it panics if we declare variables like
Sometimes it is fair to define some variables to hold sprite or sound instance during the game, which are for specific purpose that we do want to name them with some other names. That should not cause panic.
This issue proposes to remove the panic behavior when
loadSound
/loadSprite
failed because of name mismatch here.The text was updated successfully, but these errors were encountered: