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.
-
ClassDescriptionChooses an
Actor's animation frame from itsMovementState: 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 perWorldEventtype -- the role of Corgi Engine's MMFeedbacks.What one kind of event does.Receives what a reaction plays.Turns aGameLevel-- what the game builder andcom.codename1.gaming.levelauthor -- into a platformerLevelData.Reads the keyboard, a gamepad and the on-screen controls of acom.codename1.gaming.GameInputinto theInputbits aPlatformWorldsteps with.Supplies the images aPlatformViewdraws.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 aPlatformWorldon screen: steps it at a fixed 60 Hz from the player's input, draws it through aPlatformArt, follows the player with aGameCamera's follow mode and plays each tick's events throughFeedback.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 aSpriteSheetand anActorAnimator, so hand-drawn art drops into aPlatformArtwithout any code per animation.Converts between a drawncom.codename1.gaming.level.TileLayerand the collisionTileGridthe simulation reads.