Parrot Escape
by منصور الزايدي
Check out "Parrot Escape" by منصور الزايدي - featuring Canvas API, Touch Events, Sprite Manager and more. Try this Snapchat Lens on Easy Lens.
Features
- Canvas API: Procedurally renders a transparent UI overlay only (no full-screen background fill): the sliding puzzle grid and the royal cage panel, both inside one compact draggable panel (global UI scale + offset). The cage is rendered in TWO canvas passes: (1) full cage structure (back panel + label banner + frame/door opening visuals) with NO removable sticks, then (2) ONLY the 8 vertical cage sticks drawn last so they appear in front of everything. Stick visibility is controlled dynamically by live correctness of puzzle tiles (sticks disappear only while their mapped tile is currently correct, and reappear if it becomes incorrect). Replace all elephant visuals with a parrot: during gameplay, draw a colorful parrot sitting inside the cage opening (no overflow via clipping). On win, renders celebratory confetti shapes and draws the word “Winner” centered inside the cage interior (behind the sticks layer; since sticks are removed on win, it becomes fully visible). Everything outside the UI remains transparent so the live camera stays visible.
- Touch Events: Captures touch input for both: (1) dragging the whole game UI around the screen, and (2) tapping inside the puzzle grid to slide tiles.
- Sprite Manager: Used for screen size queries and (during win) escape animation positioning helper. Parrot rendering during gameplay is done in Canvas for correct look/layering; SpriteManager sprite is used only for the post-win escape animation.
- Sprite Store: Provides a single parrot texture (named exactly "parrot_royal") to be drawn inside the cage (gameplay) and used by the escape sprite (post-win).
- Text On Screen: Top UI counter text that ONLY shows how many cage sticks are broken/removed (e.g., “Cage sticks broken: 2/8”).
- Face Retouch: Light automatic face retouch so the player looks good while playing.