Set up contributor and detail scene
This commit is contained in:
parent
18850e9fb8
commit
e6536ca7c8
8 changed files with 73 additions and 3 deletions
|
|
@ -1,19 +1,31 @@
|
|||
import { mp5 } from '../../main';
|
||||
import { colors } from '../constants/colors';
|
||||
import { Player } from '../sketchObjects/Player';
|
||||
import store from '../store';
|
||||
import { Scenes } from './scenes';
|
||||
|
||||
export class DetailScene {
|
||||
player: Player;
|
||||
contributors: any;
|
||||
legacy: any;
|
||||
packages: any;
|
||||
|
||||
constructor() {
|
||||
this.player = new Player();
|
||||
|
||||
store.subscribe((state) => {
|
||||
this.contributors = state.currContributors;
|
||||
this.legacy = state.currLegacy;
|
||||
this.packages = state.currPackages;
|
||||
});
|
||||
}
|
||||
|
||||
draw() {
|
||||
mp5.background(100);
|
||||
mp5.background(mp5.color(colors.greyLighter));
|
||||
this.player.follow();
|
||||
this.player.move();
|
||||
|
||||
// TODO: Draw what can be found
|
||||
}
|
||||
|
||||
onSceneClick() {
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ export class OverviewScene {
|
|||
this.edges.forEach((edge, i) => {
|
||||
const dist = mp5.dist(mp5.mouseX, mp5.mouseY, edge.x, edge.y);
|
||||
if (dist < edge.r) {
|
||||
store.getState().setDetailScene(edge.name);
|
||||
store.setState({ currentScene: Scenes.DETAIL });
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Reference in a new issue