Skip to content

Commit

Permalink
xmas: Build fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
TomNuttall committed Dec 3, 2024
1 parent 192b02d commit fb121ff
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions frontend/xmas/src/Components/Player/Player.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const Player: React.FC<PlayerProps> = ({
}, [gameState])

const drawRectangle = useCallback(
(g) => {
(g: any) => {
g.clear()
g.lineStyle(1, 0x000000)
g.beginFill(0xffffff)
Expand All @@ -71,7 +71,7 @@ const Player: React.FC<PlayerProps> = ({
)

const drawCircle = useCallback(
(g) => {
(g: any) => {
g.clear()
g.lineStyle(1, 0x000000)
g.beginFill(0xffcccb)
Expand Down
8 changes: 6 additions & 2 deletions frontend/xmas/src/Containers/Background/Background.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,19 @@ const Background: React.FC<BackgroundProps> = ({
}, [raceDuration])

useTick((delta) => {
if (!timer || timer < 0) {
if (timer === undefined || timer < 0) {
if (raceDuration && gameState === GameState.WaitGame) {
onFinish()
}
return
}

setX((x) => x - 1.85)
setTimer((timer) => timer - delta)

setTimer((timer) => {
if (timer === undefined) return 0
return timer - delta
})
})

if (!assetsLoaded) return <></>
Expand Down
1 change: 0 additions & 1 deletion frontend/xmas/src/Containers/Players/Players.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { useCallback } from 'react'
import { Container } from '@pixi/react'
import Player from '../../Components/Player'
import { GameState, PlayerData } from '../../App'
Expand Down

0 comments on commit fb121ff

Please sign in to comment.