Created
May 2, 2019 08:17
-
-
Save lucas-jones/3e4e4e129a1a14f1403202e249c190bd to your computer and use it in GitHub Desktop.
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
interface Config { | |
boxColor: number, | |
backgroundColor: number, | |
modelUrl: string, | |
} | |
class Game { | |
options: Config; | |
constructor(options: Config) { | |
this.options = options; | |
this.makeBox(this.options.boxColor); | |
this.makeBg(this.options.backgroundColor); | |
} | |
makeBox(col:number) { | |
// .. create box | |
} | |
makeBg(col:number) { | |
// .. make background | |
} | |
} | |
const redWorld: Config = { | |
backgroundColor: 0xff0000, | |
boxColor: 0xff0000, | |
modelUrl: ".../" | |
} | |
const blueWorld: Config = { | |
backgroundColor: 0x0000ff, | |
boxColor: 0x0000ff, | |
modelUrl: ".../dave" | |
} | |
new Game(redWorld); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment