Difference between revisions of "Today"
From CodeStuff
| Line 64: | Line 64: | ||
} | } | ||
| − | function | + | function play() { |
var dx = c.x-c.lastx; | var dx = c.x-c.lastx; | ||
var dy = c.y-c.lasty; | var dy = c.y-c.lasty; | ||
| Line 114: | Line 114: | ||
moveTowards(meep,c); | moveTowards(meep,c); | ||
} | } | ||
| + | |||
| + | if ( (gameAge %300) === 0) { | ||
| + | addChaser(400,400,0.45+ gameAge/3000,"magenta"); | ||
| + | } | ||
| + | } | ||
| + | |||
| + | function draw() { | ||
clear(); | clear(); | ||
| Line 126: | Line 133: | ||
setColour("black"); | setColour("black"); | ||
print("the game age is "+gameAge); | print("the game age is "+gameAge); | ||
| − | print(gameAge % | + | print(gameAge % 300); |
} | } | ||
| + | function move() { | ||
| + | gameAge+=1; | ||
| + | if (stillAlive) { | ||
| + | play(); | ||
| + | } | ||
| + | if (keyIsDown(32)) { | ||
| + | stillAlive=false; | ||
| + | } | ||
| + | draw(); | ||
| + | } | ||
run(move); | run(move); | ||
| + | |||
</edcode> | </edcode> | ||
Revision as of 01:32, 5 July 2017
Useful things to refer to.
The API page has a list of some of the functions you can use such as