Starter: Action Pack #1
This starter requires
- Get It Here!
This starter pack is designed to get you started writing games similar to:
Flappy Bird | Escape | Bouncing Ball 2 | Flappy Color | Circle |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
code 569 lines | code 594 lines | code 601 lines | code 591 lines | code 616 |
comments 600 lines | comments 596 lines | comments 599 lines | comments 598 lines | comments 579 lines |
What Do These Games Have In Common?
These action games all share most of these features:
- The World
- Scrolls from right-to-left.
- Is (usually) endless.
- Is (probably) generated randomly.
- Note: Escape has both random generation and fixed content. The starter that comes with this kit shows generation.
- Player
- Stays horizontally centered on the screen.
- Dies if it hits the floor or ceiling.
- May die if it hits an obstacle like pipes in "Flappy Bird".
- Goal(s)
- Pass through gates, and/or
- Avoid obstacles, and/or
- Bounce off platforms, and/or
- Pick up coins/gems, AND
- Stay alive.
- Inputs - One Touch ( Tap or Touch and Release)
What Is A Starter?
Starters Are
"Focused examinations of game and app mechanics," with these primary goals,
- Provide a way (for you) to examine and understand how specific mechanics are implemented.
- Give you a working piece of code to extend and expand to suit your own needs.
- Keep game and app development simple and fun.
Starters Are Not
- Templates
- Complete Games
Starters demonstrate the tricky bits that are specific to a game or mechanic. How you polish your final game is up to you.
~ The Roaming Gamer
Contents Of This Pack
template\
- The base starter from which all examples are derived.examples\
- Five example game starters in two formats: Standalone & Framed.- Standalone* - Basic mechanics of game w/o a composer. framework.
- Framed* - Standalone + composer. framework.
frame\
- Starter (composer.*) game framework, including these interfaces: Splash, Home, and PlayGUI.credits.txt
- List of credits and sources for free assets used in examples/template.license.txt
- Licensing rules for this pack.readMe.txt
- Info about the pack.
Documentation?
Please see Template Overview for an examination of the template
project.
The five sample game starterss are not externally documented, but have significant comments in the code:
- Flappy Bird - 569 lines of code; 600 lines of comments.
- Escape - 594 lines of code; 596 lines of comments.
- Bouncing Ball 2 - 601 lines of code; 599 lines of comments.
- Flappy Color - 591 lines of code; 598 lines of comments.
- Circle - 616 lines of code; 579 lines of comments.
Example
Here is an excerpt from the Player factory (~/scripts/factories/player.lua
) in the 'Flappy Bird' starter:
-- ==
-- new() - Create new instance(s) of this factory's object(s).
-- ==
function factory.new( group, x, y, params )
params = params or { }
-- Create player
local player = newImageRect( group, x, y, "images/rg256.png",
{ w = 40, h = 40, alpha = 1 },
{ isFixedRotation = true,
calculator = myCC, colliderName = "player"} )
--
-- Track player's initial x-position
--
player.x0 = player.x
--
-- Add 'enterFrame' listener to player to:
--
-- 1. Dampen vertical velocity, using actions library.
-- 2. Maintain forward velocity.
-- 3. Count distance progress.
--
player.enterFrame = function( self )
... and so on
Copyright © Roaming Gamer, LLC. 2008-2016; All Rights Reserved