Skip to content

Commit

Permalink
Fix graphics bug caused by broken animation circle
Browse files Browse the repository at this point in the history
  • Loading branch information
SpacialCircumstances committed Jan 5, 2025
1 parent f188546 commit 460bff2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions client/src/game/animation.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
import * as PIXI from 'pixi.js'
import type { Location } from '@solaris-common';
import {Application, Ticker, Container, Graphics} from 'pixi.js';

class AnimationService {
drawSelectedCircle (app, container, location) {
drawSelectedCircle (app: Application, container: Container, location: Location) {
// It ain't pretty, but it works.
let graphics = new PIXI.Graphics()
let graphics = new Graphics()

let radius = 1

const animation = (delta) => {
const animation = (ticker: Ticker) => {
if (graphics.alpha <= 0) {
return
}

const delta = ticker.deltaTime;

graphics.clear()

radius = radius + delta
Expand Down
2 changes: 1 addition & 1 deletion client/src/game/star.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Application, BitmapText, Circle, Container, Graphics, Sprite, TextStyle} from 'pixi.js';
import {Application, BitmapText, Circle, Container, Graphics, Sprite} from 'pixi.js';
import TextureService from './texture'
import gameHelper from '../services/gameHelper.js'
import seededRandom from 'random-seed'
Expand Down

0 comments on commit 460bff2

Please sign in to comment.