Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Change bullet graphic

  • Loading branch information...
commit 00794cd0f7da523ff11d900266df2c906d5d4755 1 parent 814919f
Daniel Mark Schwartz authored
View
1  .gitignore
@@ -4,3 +4,4 @@ todo.txt
*.swp
*.swn
*.swo
+*.xcf
View
BIN  bullet.gif
Deleted file not rendered
View
BIN  bullet.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
4 game.coffee
@@ -2,7 +2,7 @@ randInRange = (l, h) ->
l + Math.random() * (h - l)
bulletImage = new Image
-bulletImage.src = 'bullet.gif'
+bulletImage.src = 'bullet.png'
shipImage0 = new Image
shipImage0.src = 'monk_0.png'
@@ -194,7 +194,7 @@ class Game extends atom.Game
atom.context.fillText "Enemies: #{@enemies.length}", 10, 120
spawnBullet: (x, y, dx, dy) ->
- @bullets.push new Bullet x, y, dx, dy, 25
+ @bullets.push new Bullet x, y, dx, dy, bulletImage.width/2
spawnEnemy: (x, y, dx, dy, bulletFreq, bulletSpeed) ->
@enemies.push new Enemy x, y, dx, dy, bulletFreq, bulletSpeed, 10
Please sign in to comment.
Something went wrong with that request. Please try again.