Skip to content

Commit

Permalink
Tweaked the UFOs to make them a bit easier to hit
Browse files Browse the repository at this point in the history
  • Loading branch information
Philipp Sehmisch committed Sep 21, 2020
1 parent 4def647 commit 1de2c20
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

*.zip
*.js.map
*.js
5 changes: 5 additions & 0 deletions constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ const CONST = {
MOB_BIRD_MOVE_TIME: 10, // time it takes for the bird to move through its range
MOB_UFO_RADIUS: 55, // radius of the collision hitcircle
MOB_UFO_ANIMATION_LENGHT: 0.2, // time for one animation cycle of the ufo
MOB_UFO_MOVE_RANGE_X: 600,
MOB_UFO_MOVE_TIME_X: 12,
MOB_UFO_MOVE_RANGE_Y: 200,
MOB_UFO_MOVE_TIME_Y: 4,


// render order layers
LAYER_BG: -1,
Expand Down
4 changes: 2 additions & 2 deletions mob.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ class Ufo extends Entity {
this.collisionRadiusSqare = CONST.MOB_UFO_RADIUS * CONST.MOB_UFO_RADIUS

this.behaviors.push(new AnimatedBehavior(CONST.MOB_UFO_ANIMATION_LENGHT, true))
this.behaviors.push(new SineMovementBehavior(this, 600, 10, "x"))
this.behaviors.push(new SineMovementBehavior(this, 200, 4, "y"))
this.behaviors.push(new SineMovementBehavior(this, CONST.MOB_UFO_MOVE_RANGE_X, CONST.MOB_UFO_MOVE_TIME_X, "x"))
this.behaviors.push(new SineMovementBehavior(this, CONST.MOB_UFO_MOVE_RANGE_Y, CONST.MOB_UFO_MOVE_TIME_Y, "y"))
}
}

Expand Down

0 comments on commit 1de2c20

Please sign in to comment.