Difference between revisions of "Today"

From CodeStuff
Jump to: navigation, search
Line 1: Line 1:
*[[star]]
 
*[[man]]
 
 
 
<edcode>
 
<edcode>
  
 +
var player = {x:300,y:400}
 +
var alien = {x:200,y:100}
 +
var bullet = {x:200, y:200}
 +
 +
 +
function move() {
 +
 
 +
}
 +
 +
function draw() {
 +
  print("player");
 +
  print(player.x);
 +
  print(player.y);
 +
 
 +
  drawPlayerShip(player.x,player.y);
 +
 +
  drawAlienShip(alien.x,alien.y);
 +
 +
  drawBullet(bullet.x,bullet.y)
 +
}
 +
 +
function drawPlayerShip(x,y) {
 +
  drawLine(x,y-30, x+10,y+30);
 +
  drawLine(x,y-30, x-10,y+30);
 +
}
  
 +
function drawAlienShip(x,y) {
 +
  fillCircle(x,y,20);
 +
}
  
 +
function drawBullet(x,y) {
 +
  fillCircle(x,y,3);
 +
}
 +
run(move,draw);
  
 
</edcode>
 
</edcode>

Revision as of 22:26, 26 September 2012