Hi all,
I continue my quest to produce a passable clone of the 194X type vertical shooter, based on the excellent Side-Scroller from Scratch tutorial.
My enemy planes are basically the stars from the original tutorial moving in a different direction.
My player plane spawns bullets which are basically stars moving in the opposite direction.
Currently I can detect the different collision types so that a enemy plane hit by a bullet produces an increase in score, and a red plane colliding with the playerâs plane produces a huge reduction in score. I plan to change this to a loss of a life with four or five lives represented by images of the playerâs plane near the top right of the screen.
Iâve tried to make the enemy planes disappear into an explosion (sprite borrowed from the War Battle tutorial).
Iâve tried using
lua
sprite.play_flipbook("#explosion", "explosion")
to play the sprite. The sprite is in the same atlas as everything else, including the enemy plane sprites.
The error message I get is:
Component â/instance0#explosionâ could not be found when dispatching message âplay_animationâ sent from main:/instance0#red_plane
I checked the explosion sprite ID , it definitely explosion.
Obviously I am missing something important and/or fundamental.
Should I be treating the explosion sprite as just an extra animation added onto the enemy plane script or should I be creating them as a separate object, powered and created by their own factory?
Any help or suggestions welcome.
Thanks and regards
Frank

