Skip to content

Commit

Permalink
Increase enemy tanks speed
Browse files Browse the repository at this point in the history
  • Loading branch information
elfedy committed Jun 16, 2023
1 parent 48f1936 commit f109499
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
1 change: 0 additions & 1 deletion src/config/dev.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// NOTE: dev config, should only be used in dev builds
const Config = {
debug: true,
};
1 change: 0 additions & 1 deletion src/config/prod.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// NOTE: prod config, should only be used in prod builds
const Config = {
debug: false,
};
10 changes: 5 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -694,13 +694,13 @@ function tankGetData(tankType: string): TankData {
playerNormal: {
width: 35,
height: 35,
defaultSpeed: 100,
defaultSpeed: 200,
bulletSpeed: 800,
},
enemyNormal: {
width: 35,
height: 35,
defaultSpeed: 100,
defaultSpeed: 200,
bulletSpeed: 800,
},
}[tankType];
Expand All @@ -725,8 +725,8 @@ function pickRandomDirection(): string {

//NOTE(Fede) Asumes tank is effectively moving in its direction
function tankEstimateMovement(tank: Tank, dt: number) : Vector2 {
var dx = 0;
var dy = 0;
let dx = 0;
let dy = 0;
if(tank.direction === "right") {
dx += Math.floor(tank.speed * dt / 1000);
} else if(tank.direction === "left") {
Expand Down Expand Up @@ -1255,7 +1255,7 @@ function arrayUnique(array: any[]): any[] {
return result;
}

function DEBUG(log: string) {
function DEBUG(log: any) {
if (Config.debug) {
console.log(log);
}
Expand Down

0 comments on commit f109499

Please sign in to comment.