Skip to content

Commit

Permalink
Add GameData module
Browse files Browse the repository at this point in the history
  • Loading branch information
una-ada committed Jun 1, 2021
1 parent de63982 commit a312215
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 5 deletions.
6 changes: 4 additions & 2 deletions js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
import Game from "./modules/Game.js";
import DOMRenderer from "./modules/DOMRenderer.js";
import Physics from "./modules/Physics.js";
import GameData from "./modules/GameData.js";

const
game = new Game(),
state = new GameData(),
renderer = new DOMRenderer(),
phys = new Physics();
phys = new Physics(state),
game = new Game(state);
5 changes: 4 additions & 1 deletion js/modules/DOMRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ export default
* Class for rendering views
*/
class DOMRenderer {
/**
* Initialize a DOM-based renderer
*/
constructor(){
console.log("DOMRenderer works!")
}
}
}
2 changes: 1 addition & 1 deletion js/modules/Game.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ export default
constructor(){
console.log("Game works!")
}
}
}
16 changes: 16 additions & 0 deletions js/modules/GameData.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/**
* Rendering module using the DOM
* @module modules/GameData
*/
export default
/**
* The game state (model)
*/
class GameData {
/**
* Create object to hold game states
*/
constructor(){
console.log("GameData works!")
}
}
2 changes: 1 addition & 1 deletion js/modules/Physics.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ export default
constructor(){
console.log("Physics works!")
}
}
}

0 comments on commit a312215

Please sign in to comment.