Skip to content

Commit

Permalink
Merge pull request #59 from neki-dev/develop
Browse files Browse the repository at this point in the history
Update to 1.11.1
  • Loading branch information
neki-dev authored Oct 12, 2023
2 parents ed93ca4 + 0cc4ffd commit 83b91b1
Show file tree
Hide file tree
Showing 12 changed files with 37 additions and 22 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "izowave",
"description": "Isometric game. Build and defense in open world",
"version": "1.11.0",
"version": "1.11.1",
"keywords": [
"game",
"isometric",
Expand Down
Binary file modified src/assets/sprites/building/textures/ammunition.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/const/world/difficulty.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,10 @@ export const DIFFICULTY = {
*/

BUILDING_AMMUNITION_COST: 40, // Building cost
BUILDING_AMMUNITION_HEALTH: 400, // Health
BUILDING_AMMUNITION_HEALTH: 600, // Health
BUILDING_AMMUNITION_ALLOW_BY_WAVE: 3, // Minimal wave for allow build
BUILDING_AMMUNITION_RADIUS: 120, // Heal radius
BUILDING_AMMUNITION_RADIUS_GROWTH: 0.25, // Radius growth by level (Linear)
BUILDING_AMMUNITION_RADIUS_GROWTH: 0.33, // Radius growth by level (Linear)
BUILDING_AMMUNITION_AMMO: 120, // Ammo amount
BUILDING_AMMUNITION_AMMO_GROWTH: 1.0, // Ammo amount growth by level (Quadratic)

Expand Down
4 changes: 4 additions & 0 deletions src/game/scenes/world/builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,10 @@ export class Builder extends EventEmitter implements IBuilder {
y: this.scene.input.activePointer.worldY,
};
} else {
if (this.scene.camera.isZooming()) {
return;
}

const pointer = this.getCurrentPointer();

if (!pointer.active || pointer.event.target !== this.scene.sys.canvas) {
Expand Down
16 changes: 9 additions & 7 deletions src/game/scenes/world/camera.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,7 @@ export class Camera implements ICamera {
});
} else {
this.scene.input.on(Phaser.Input.Events.POINTER_MOVE, () => {
if (this.scene.game.screen.isJoystickUsing()) {
return;
}

const isMultitouch = this.scene.input.pointer1.isDown && this.scene.input.pointer2.isDown;

if (!isMultitouch) {
if (!this.isZooming()) {
return;
}

Expand All @@ -84,6 +78,14 @@ export class Camera implements ICamera {
}
}

public isZooming() {
if (this.scene.game.screen.isJoystickUsing()) {
return false;
}

return this.scene.input.pointer1.isDown && this.scene.input.pointer2.isDown;
}

private updateZoom(value: number) {
const camera = this.scene.cameras.main;
const zoom = camera.zoom - value;
Expand Down
2 changes: 1 addition & 1 deletion src/game/scenes/world/entities/building/building.ts
Original file line number Diff line number Diff line change
Expand Up @@ -845,7 +845,7 @@ export class Building extends Phaser.GameObjects.Image implements IBuilding, ITi

public loadSavePayload(data: BuildingSavePayload) {
if (data.upgradeLevel > 1) {
this.upgradeLevel = data.upgradeLevel;
this.upgradeLevel = Math.min(data.upgradeLevel, this.getMeta().MaxLevel);

this.updateActionArea();
this.setFrame(this.upgradeLevel - 1);
Expand Down
14 changes: 9 additions & 5 deletions src/game/scenes/world/entities/building/variants/ammunition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class BuildingAmmunition extends Building implements IBuildingAmmunition

static AllowByWave = DIFFICULTY.BUILDING_AMMUNITION_ALLOW_BY_WAVE;

static MaxLevel = 4;
static MaxLevel = 3;

private maxAmmo: number = DIFFICULTY.BUILDING_AMMUNITION_AMMO;

Expand Down Expand Up @@ -152,13 +152,17 @@ export class BuildingAmmunition extends Building implements IBuildingAmmunition
Tutorial.Complete(TutorialStep.BUY_AMMO);
}

private onUpgrade() {
const maxAmmo = progressionQuadratic({
private getMaxAmmo() {
return progressionQuadratic({
defaultValue: DIFFICULTY.BUILDING_AMMUNITION_AMMO,
scale: DIFFICULTY.BUILDING_AMMUNITION_AMMO_GROWTH,
level: this.upgradeLevel,
roundTo: 10,
});
}

private onUpgrade() {
const maxAmmo = this.getMaxAmmo();
const addedAmmo = maxAmmo - this.maxAmmo;

this.maxAmmo = maxAmmo;
Expand All @@ -175,8 +179,8 @@ export class BuildingAmmunition extends Building implements IBuildingAmmunition
public loadSavePayload(data: BuildingSavePayload) {
super.loadSavePayload(data);

if (data.ammo) {
this.ammo = data.ammo;
if (data.ammo !== undefined) {
this.ammo = Math.min(data.ammo, this.getMaxAmmo());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ export class BuildingTower extends Building implements IBuildingTower {
public loadSavePayload(data: BuildingSavePayload) {
super.loadSavePayload(data);

if (data.ammo) {
if (data.ammo !== undefined) {
this.ammo = data.ammo;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export class EnemyTank extends Enemy {
...data,
texture: EnemyTexture.TANK,
multipliers: {
health: 1.0,
health: 1.2,
damage: 0.6,
speed: 0.7,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ export class EnemyTermer extends Enemy {
...data,
texture: EnemyTexture.TERMER,
multipliers: {
health: 1.7,
damage: 1.1,
health: 1.8,
damage: 1.0,
speed: 0.8,
},
});
Expand Down
5 changes: 5 additions & 0 deletions src/types/world/camera.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,9 @@ export interface ICamera {
* Add zoom control.
*/
addZoomControl(): void

/**
* Check is zooming by touches.
*/
isZooming(): boolean
}

0 comments on commit 83b91b1

Please sign in to comment.