Skip to content

Instantly share code, notes, and snippets.

@Westenburg
Westenburg / Main
Created June 9, 2013 13:55
Basic version of Foggy Bummer - a side scrolling game written in Codea
-- Foggy Bummer
-- By West
--Game overview: A sideways scroller where the player controls a bumblebee. Touch screen to provide upward thrust to the bee. Collect as many rings as you can in 24 hours or until you complete the full course. Don't hit the top or bottom of the screen.
--Feel free to use this code as you wish to help you learn and understand codea. Most of the images are either hand drawn or sections extracted from photos - feel free to use, mangle and adapt the sprite sheet too. Just please don't take the code and images wholesale and upload them to the apple store!
--Often a good way to learn to program is to take existing code, tweak it and build on it. Hopefully this will give someone a foot up towards making their own sideways scroller. This is the most basic version, but I've also added the following if anyone is interested
--Added bonuses
@Westenburg
Westenburg / Main
Created June 11, 2013 21:47
More advanced version of foggy bummer with particles, weather and bonuses. Two tabs - Particle and Main. New to GitHub so not sure if I've implemented correctly. Written for Codea
--# Particle
Particle = class()
--Class to deal with individual particles. Used for the starburst and raindrops
function Particle:init(x,y,xspd,yspd,type,fade)
-- you can accept and set parameters here
--map to the position of the 100 by 100 blocks in the sprite sheet. The location in the array refers to the type of particle
local map={}
map[1]={x=0, y=4}--stars
map[2]={x=2, y=4}--rain
@Westenburg
Westenburg / Noob lander
Created June 17, 2013 19:26
A step by step tutorial on creating a simple lunar lander game in Codea. Contains 13 tabs. Each tab contains one step in the tutorial and successive tabs build on each other. Drag the tab you wish to run to the far right then press the run button
--# Main
-- Noob Lander
-- by West
-- This is a very simple example lunar lander game. It is intended for use as an introduction into creating your first game in codea and is aimed at absolute beginners.
--ONLY THE FURTHEST RIGHT HAND TAB WILL BE EXECUTED. DRAG THE TAB FOR THE STEP YOU WISH TO RUN TO THE FAR RIGHT THEN PRESS RUN
--The game was built using the following steps. Each step is provided in its own tab and builds upon the previous one. For each tab only comments related to that particular step are provided but a fully commented version is provided below.
--1. Place the ship sprite on the screen at a pre-defined position (use one of the pre-loaded sprite packs)
@Westenburg
Westenburg / Snake
Created September 8, 2013 18:58
A step by step tutorial for a Snake game in Codea. Aimed at absolute beginners (though would recommend starting with the Noob Lander tutorial first). Each step is commented and in its own separate tab- move the tab you wish to run to the far right
--# Main
-- Snake tutorial
-- by West
--Graphics used are those supplied with Codea, particularly those of Kenney.nl and twolivesleft.com
-- This is a very simple example snake game. It is intended for use as an introduction into creating your second game in codea and is aimed at absolute beginners. Try the lander tutorial before this one
--ONLY THE FURTHEST RIGHT HAND TAB WILL BE EXECUTED. DRAG THE TAB FOR THE STEP YOU WISH TO RUN TO THE FAR RIGHT THEN PRESS RUN
@Westenburg
Westenburg / Asteroids tutorial
Last active March 18, 2023 17:46
A step by step tutorial for Asteroids written in Codea aimed at beginners. I would recommend looking at the Noob Lander and Snake tutorial before this one if you haven't done any coding before. In fact, this tutorial builds on the first few steps of the Snake tutorial. Also there is more involved in each step and the comments are less line by li…
--# Main
--Main
--This code manages which Code tab is run
--it remembers your last choice, and if you select a different one, it runs that instead
local tabs = {}
local fnames = {"setup","draw","touched","collide","orientationChanged","close","restart","keyboard","cleanup"}
local fns = {}
@Westenburg
Westenburg / WellFaller
Last active January 1, 2016 11:39
Codea cook off entry in progress. First release.
-- Well Racer
-- Codea Cook Off 2013
-- by West
-- v1.0 First release
supportedOrientations(PORTRAIT_ANY)
function draw()
func()
end
@Westenburg
Westenburg / Main
Created August 12, 2014 07:55
Missile Command Type game
-- Missile command type game
-- by West
displayMode(FULLSCREEN)
function setup()
touches={}
tsup={} --tsup contains the supplementary info about the start position of the touch
resetGame()
--starfield setup --credit to Simeon @TLL: http://codea.io/talk/discussion/644/flicker-drawing-large-images-any-advice/p1
local gradSize = 2
@Westenburg
Westenburg / Runner
Created March 14, 2015 06:13
Simple endless runner
-- Mountains
-- Simple endless runner game by West
-- taking inspiration from "Alto's adventure" for the Mountain backdrop and day to night cycle
-- Use this function to perform your initial setup
function setup()
--get rid of the sidebar
displayMode(FULLSCREEN)
-- define 3 the three game states for the finite state machine game engine and initialise gamestate variable
READY=1
GAMEOVER=2
@Westenburg
Westenburg / People Popcorn
Last active August 29, 2015 14:17
People Popcorn - Codea Game Jam 2015
-- People Popcorn
-- by West
--two space chameleons, Clive and Agnes descend on the unsuspecting planet. Who will gobble up the most people?
supportedOrientations(LANDSCAPE_ANY)
-- Use this function to perform your initial setup
function setup()
displayMode(FULLSCREEN_NO_BUTTONS)
-- displayMode(FULLSCREEN)
WALK=1
@Westenburg
Westenburg / Main
Created March 30, 2015 06:49
Simple invaders
-- Touch based space invaders
-- by West
-- Use this function to perform your initial setup
supportedOrientations(PORTRAIT_ANY)
function setup()
displayMode(FULLSCREEN)
READY=1
GAMEOVER=2
PLAY=3