Skip to content

Commit

Permalink
Merge pull request #92 from neki-dev/develop
Browse files Browse the repository at this point in the history
Update to 1.16.4
  • Loading branch information
neki-dev authored Oct 30, 2023
2 parents 87ad7d9 + 1f79d8a commit 88a344b
Show file tree
Hide file tree
Showing 12 changed files with 39 additions and 35 deletions.
Binary file modified src/assets/sprites/level/earth/tiles.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/assets/sprites/level/mars/tiles.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/assets/sprites/level/moon/tiles.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 6 additions & 3 deletions src/const/game.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,26 @@ export const ENVIRONMENTS: Record<GamePlatform, GameEnvironment> = {
[GamePlatform.POKI]: {
sdk: 'https://game-cdn.poki.com/scripts/v2/poki-sdk.js',
flags: {
[GameFlag.NO_BLOOD]: true,
[GameFlag.ADS]: true,
[GameFlag.AUTO_ORIENTATION]: true,
},
},
[GamePlatform.CRAZY_GAMES]: {
sdk: 'https://sdk.crazygames.com/crazygames-sdk-v2.js',
flags: {
[GameFlag.NO_BLOOD]: true,
[GameFlag.ADS]: true,
[GameFlag.COPYRIGHT]: true,
},
},
[GamePlatform.VANILLA]: {
flags: {},
flags: {
[GameFlag.BLOOD]: true,
[GameFlag.COPYRIGHT]: true,
},
},
[GamePlatform.DEVELOPMENT]: {
flags: {
[GameFlag.BLOOD]: true,
[GameFlag.ADS]: true,
},
},
Expand Down
18 changes: 12 additions & 6 deletions src/game/scenes/menu/interface/copyright/index.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
import React from 'react';

import pkg from '../../../../../../package.json';
import { Environment } from '~lib/environment';
import { GameFlag } from '~type/game';

import {
Wrapper, Icon, About, Discord, Link, Version,
Wrapper, Icon, About, Discord, Author, Link,
} from './styles';

export const Copyright: React.FC = () => (
<Wrapper>
<About>
Created by{' '}
<Link href={pkg.author.url} target="_blank">
{pkg.author.name}
</Link>
<Version>Version {pkg.version}</Version>
<Author>
Created by{' '}
{Environment.GetFlag(GameFlag.COPYRIGHT) ? (
<Link href={pkg.author.url} target="_blank">
{pkg.author.name}
</Link>
) : pkg.author.name}
</Author>
Version {pkg.version}
</About>
<Discord href='https://discord.gg/cnFAdMsRxn' target="_blank">
<Icon src='assets/discord.png' />
Expand Down
14 changes: 7 additions & 7 deletions src/game/scenes/menu/interface/copyright/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ export const About = styled.div`
}
`;

export const Author = styled.div`
margin-bottom: 8px;
@media ${INTERFACE_MOBILE_BREAKPOINT} {
margin-bottom: 5px;
}
`;

export const Link = styled.a`
color: #fff;
pointer-events: all;
Expand All @@ -35,13 +42,6 @@ export const Link = styled.a`
}
`;

export const Version = styled.div`
margin-top: 8px;
@media ${INTERFACE_MOBILE_BREAKPOINT} {
margin-top: 5px;
}
`;

export const Discord = styled.a`
margin-top: 10px;
color: #fff;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,15 +186,15 @@ export class BuildingTower extends Building implements IBuildingTower {
if (ammunition) {
this.ammo += ammunition.use(DIFFICULTY.BUIDLING_TOWER_AMMO_AMOUNT);

Tutorial.Complete(TutorialStep.RELOAD_TOWER);

if (this.needReload) {
this.removeAlertIcon();
this.needReload = false;

if (this.scene.game.sound.getAll(BuildingAudio.RELOAD).length === 0) {
this.scene.game.sound.play(BuildingAudio.RELOAD);
}

Tutorial.Complete(TutorialStep.RELOAD_TOWER);
}
} else if (!this.needReload) {
this.addAlertIcon();
Expand Down
2 changes: 1 addition & 1 deletion src/game/scenes/world/entities/npc/variants/enemy/enemy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ export class Enemy extends NPC implements IEnemy {
if (
!this.currentBiome?.solid
|| !this.scene.game.isSettingEnabled(GameSettings.EFFECTS)
|| Environment.GetFlag(GameFlag.NO_BLOOD)
|| !Environment.GetFlag(GameFlag.BLOOD)
) {
return;
}
Expand Down
3 changes: 1 addition & 2 deletions src/game/scenes/world/entities/player.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {
import { LEVEL_MAP_PERSPECTIVE } from '~const/world/level';
import { Crystal } from '~entity/crystal';
import { Sprite } from '~entity/sprite';
import { Analytics } from '~lib/analytics';
import { Assets } from '~lib/assets';
import { getClosestByIsometricDistance, isPositionsEqual } from '~lib/dimension';
import { progressionLinear, progressionQuadratic } from '~lib/progression';
Expand Down Expand Up @@ -654,7 +653,7 @@ export class Player extends Sprite implements IPlayer {
frameRate: (this.stamina) === 0.0 ? 6 : 8,
});
} catch (error) {
Analytics.TrackWarn((error as TypeError).message);
//
}
}

Expand Down
19 changes: 7 additions & 12 deletions src/game/scenes/world/entities/shot/ball/ball.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,24 +137,21 @@ export class ShotBall extends Phaser.Physics.Arcade.Image implements IShotBall {
}

private hit(target: IEnemy) {
this.stop();

const { damage, freeze } = this.params;

if (freeze && target.live.armour <= 0) {
const duration = freeze / this.scale;

target.freeze(duration, true);
target.freeze(freeze, true);
}

if (damage) {
target.live.damage(damage);

if (!this.active) {
return;
}

const enemies = this.scene.getEntities<IEnemy>(EntityType.ENEMY);
const position = target.getBottomFace();

this.scene.getEntities<IEnemy>(EntityType.ENEMY).forEach((enemy) => {
target.live.damage(damage);

enemies.forEach((enemy) => {
if (enemy !== target) {
const distance = getIsometricDistance(position, enemy.getBottomFace());

Expand All @@ -168,8 +165,6 @@ export class ShotBall extends Phaser.Physics.Arcade.Image implements IShotBall {
}
});
}

this.stop();
}

private stop() {
Expand Down
2 changes: 1 addition & 1 deletion src/game/scenes/world/entities/sprite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ export class Sprite extends Phaser.Physics.Arcade.Sprite implements ISprite {
public onDamage(amount: number) {
if (
!this.scene.game.isSettingEnabled(GameSettings.EFFECTS)
|| Environment.GetFlag(GameFlag.NO_BLOOD)
|| !Environment.GetFlag(GameFlag.BLOOD)
) {
return;
}
Expand Down
3 changes: 2 additions & 1 deletion src/types/game.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,10 @@ export enum GameDifficulty {
}

export enum GameFlag {
NO_BLOOD = 'NO_BLOOD',
BLOOD = 'BLOOD',
ADS = 'ADS',
AUTO_ORIENTATION = 'AUTO_ORIENTATION',
COPYRIGHT = 'COPYRIGHT',
}

export enum GamePlatform {
Expand Down

0 comments on commit 88a344b

Please sign in to comment.