-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from MatsMaker/develop
Develop
- Loading branch information
Showing
74 changed files
with
2,931 additions
and
256 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,28 @@ | ||
# Example using webpack and pixijsv5 and pixi-inspector extension tools | ||
# Description | ||
|
||
Example use **redux** with **pixijs** | ||
|
||
# How use | ||
|
||
### Run dev mode | ||
``` | ||
npm start | ||
``` | ||
Then go to http://localhost:8080 | ||
|
||
### Make build | ||
``` | ||
npm run build | ||
``` | ||
|
||
# Description game | ||
|
||
Card size 3*2 fields + filed for bonus | ||
Classic scratcher game where User needs to find 3 symbols to win coins/cash. | ||
Also User has a bonus filed which will contain some guaranteed prize | ||
User scratches the field to check the symbols, in case 3 symbols are the same – User gets a payout. | ||
|
||
## Screenshots | ||
|
||
![Alt text](screenshots/screen_1.png) | ||
![Alt text](screenshots/screen_2.png) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import { Container } from 'pixi.js'; | ||
import { injectable } from 'inversify'; | ||
import Config from '../../core/config/Config'; | ||
import AssetsLoader from '../../core/assetsLoader/AssetsLoader'; | ||
import { StoreType } from 'store'; | ||
import { onEvent } from '../../utils/store.subscribe'; | ||
import ViewPort from '../../core/viewPort/ViewPort'; | ||
|
||
@injectable() | ||
abstract class ABaseContainer { | ||
|
||
protected store: StoreType | ||
protected config: Config | ||
protected assetsLoader: AssetsLoader | ||
protected viewPort: ViewPort | ||
protected container: Container | ||
protected name: string = 'AContainer' | ||
protected zIndex: number = 0 | ||
|
||
constructor( | ||
) { | ||
} | ||
|
||
get view(): Container { | ||
return this.container; | ||
} | ||
|
||
protected init(): void { | ||
this.initContainer() | ||
this.initListeners() | ||
} | ||
|
||
protected initContainer(): void { | ||
this.container = new Container(); | ||
this.container.visible = false; | ||
this.container.zIndex = this.zIndex; | ||
this.container.name = this.name; | ||
} | ||
|
||
protected initListeners(): void { | ||
const { subscribe } = this.store | ||
subscribe(onEvent(`@CONTAINER/${this.name}/render`, | ||
() => this.viewPort.addTickOnce(this.render))) | ||
subscribe(onEvent(`@CONTAINER/${this.name}/re_render`, | ||
() => this.viewPort.addTickOnce(this.reRender))) | ||
} | ||
|
||
protected render = () => { | ||
this.renderContent(); | ||
this.reRender(); | ||
this.container.visible = true; | ||
} | ||
|
||
protected renderContent = () => { | ||
} | ||
|
||
protected reRender = () => { | ||
} | ||
|
||
} | ||
|
||
export default ABaseContainer; |
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,7 +1,13 @@ | ||
import { RENDER_BACKGROUND, ActionTypes } from './types' | ||
import { RENDER_BACKGROUND, ActionTypes, RE_RENDER_BACKGROUND } from './types' | ||
|
||
export function renderBackground(): ActionTypes { | ||
export function renderBackgroundAction(): ActionTypes { | ||
return { | ||
type: RENDER_BACKGROUND, | ||
} | ||
} | ||
|
||
export function reRenderBackgroundAction(): ActionTypes { | ||
return { | ||
type: RE_RENDER_BACKGROUND, | ||
} | ||
} |
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
Oops, something went wrong.