Package com.codename1.gaming.platformer.view


package com.codename1.gaming.platformer.view

Draws and plays a com.codename1.gaming.platformer.PlatformWorld: the client half of the platformer engine.

PlatformView is a com.codename1.gaming.GameView that steps the world at a fixed 60 Hz from an InputMapper (keyboard, gamepad, on-screen controls), interpolates drawing between ticks, follows the player with a GameCamera's follow mode (dead zone, look-ahead, level bounds, shake) and plays each tick's events through Feedback. What it draws comes from a PlatformArt; ProceduralArt draws everything from code so a level is playable before any art exists, and ActorAnimator maps movement states to sprite-sheet frames.

Nothing here feeds back into the simulation, which is why the simulation package is shared with the server and this one is not.

  • Class
    Description
    Chooses an Actor's animation frame from its MovementState: the presentation half of Corgi Engine's animator parameters.
    A run of frames.
    One actor's place in its animation.
    "Juice": what the player sees and hears when something happens, chosen per WorldEvent type -- the role of Corgi Engine's MMFeedbacks.
    What one kind of event does.
    Receives what a reaction plays.
    Turns a GameLevel -- what the game builder and com.codename1.gaming.level author -- into a platformer LevelData.
    Reads the keyboard, a gamepad and the on-screen controls of a com.codename1.gaming.GameInput into the Input bits a PlatformWorld steps with.
    Supplies the images a PlatformView draws.
    3D models for actors in 2.5D (PlatformView#setDepth(boolean)). Without one, depth mode stands each actor up as a flat billboard of its sprite; with one, an actor whose kind has a model is drawn as that skinned glTF model instead, turned to face where it walks and playing the clip its state asks for. The simulation is untouched: the same level and the same replay, drawn with models.
    Plays a PlatformWorld on screen: steps it at a fixed 60 Hz from the player's input, draws it through a PlatformArt, follows the player with a GameCamera's follow mode and plays each tick's events through Feedback.
    Supplies the player's input instead of the device, for a replay or a remote player.
    Art drawn from code: flat tiles with a lit top edge, rounded characters with eyes and stepping feet, coins, keys, doors and springs.
    Imports a character drawn in Aseprite (or any tool that writes its sheet format, such as LibreSprite or TexturePacker's "JSON (Array)") as a SpriteSheet and an ActorAnimator, so hand-drawn art drops into a PlatformArt without any code per animation.
    Converts between a drawn com.codename1.gaming.level.TileLayer and the collision TileGrid the simulation reads.