Tuesday, October 25, 2016

Coding #2

Iv'e been review some of the things I did in year 5 and I found this a basic coding 'if statement '. If you have no idea what im talking about check out this good website, codeavengers

Here is the code:

var guess = prompt('8 + 4 + 2 + 1 ?')

if (guess == '15')
  alert('Correct!')
else
  alert('Incorrect!')
 
guess = prompt('8 - 4 - 2 - 1 ?')

if (guess == '1')
  alert('Correct!')
else
  alert('Incorrect!')

Monday, October 24, 2016

Coding!

In the weekend I have been doing some basic JavaScript. This is one of my games I created:

My Game!

This is the code I used:
new Game.Player(350, 50, '/image/game/player2.png')
new Game.Player(50, 50, '/image/game/player11.png', 'w', 'a', 's', 'd')

new Game.GoodItem(150, 75)
new Game.GoodItem(350, 350)
new Game.GoodItem(50, 350)
new Game.GoodItem(350, 250, 'http://mouse-master.com/idol.png')
new Game.GoodItem(30, 100, 'http://mouse-master.com/idol.png')
new Game.GoodItem(200, 500, 'http://mouse-master.com/idol.png')e

new Game.BadItem(350, 150)
new Game.BadItem(50, 150)
new Game.BadItem(200, 450)

new Game.Enemy(50, 550, '/image/game/player10.png')
new Game.Enemy(350, 550, '/image/game/player10.png')

new Game.Obstacle(200, 250)
new Game.Obstacle(50, 500)
new Game.Obstacle(350, 400)