-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Select arcadian head and use in-game
- Loading branch information
1 parent
c152d59
commit ae51247
Showing
8 changed files
with
99 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,28 @@ | ||
import { emit } from 'kontra'; | ||
import { ARCADIAN_HEAD_SELECTED } from './gameEvents'; | ||
|
||
export let gameWidth = 0; | ||
export let gameHeight = 0; | ||
const arcadianData = {}; | ||
let selectedArcadian = {}; | ||
|
||
export const setGameWidth = (width) => { | ||
gameWidth = width; | ||
}; | ||
|
||
export const setGameHeight = (height) => { | ||
gameHeight = height; | ||
}; | ||
|
||
export const setArcadianData = ({ id, data, img }) => { | ||
arcadianData[id] = { data, img }; | ||
}; | ||
|
||
export const setSelectedArcadian = (id) => { | ||
selectedArcadian = arcadianData[id]; | ||
emit(ARCADIAN_HEAD_SELECTED, { img: selectedArcadian.img }); | ||
}; | ||
|
||
export const getSelectedArcadian = () => { | ||
return selectedArcadian; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters