This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- Well Racer | |
| -- Codea Cook Off 2013 | |
| -- by West | |
| -- v1.0 First release | |
| supportedOrientations(PORTRAIT_ANY) | |
| function draw() | |
| func() | |
| end | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --# 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 = {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --# 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function setup() | |
| m=mesh() | |
| img=readImage("Cargo Bot:Starry Background") | |
| m.texture=img | |
| local v,t={},{} | |
| meshWidth,meshDepth=4000,15000 --huge mesh | |
| imgScale=0.5 --use the image at this fraction of its normal size, ie reduce it | |
| --now calculate how many times the image is used along the x and z axes | |
| --use these as the maximum texture settings | |
| --the shader will just use the fractional part of the texture mapping |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --# Main | |
| --Main | |
| --This program contains over 20 mini-projects created by dave1707 to answer questions asked in the forum | |
| --** How to run the projects ** | |
| --When you run the program, you can select any of these projects by number using the slider at upper left | |
| --(Underneath the slider you will see a textbox with descriptions of what each numbered project does) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function setup() | |
| parameter.color("Colour",color(50, 100, 150, 255),UpdateLandscape) | |
| parameter.integer("AveHeight",300,600,200,UpdateLandscape) | |
| parameter.integer("VariableHeight",100,400,200,UpdateLandscape) | |
| ready=true --this is just here to stop UpdateLandscape doing anything before we've defined all parameters | |
| parameter.number("Roughness",0,1,0.5,UpdateLandscape) | |
| parameter.action("Create Landscape",UpdateLandscape) | |
| end | |
| function UpdateLandscape() |
OlderNewer