Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ```javascript
- //main.js
- //main body of code is inside here
- //this is the main code
- //INITIALISE OBJECTS
- let player = {
- lives: 10,
- }
- let game = {
- alphabets: ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h',
- 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's',
- 't', 'u', 'v', 'w', 'x', 'y', 'z'],
- word: {
- name:result_word.toLowerCase(),
- definition:result_definition,
- get wordLetters(){
- return stringToList(this.name)
- }
- }
- }
- // keep track of true and false guessed
- game.correctList=[]
- for (var i=0; i<game.word.name.length; i++) {
- game.correctList.push( false);
- }
- //decided not to use a getter
- //set up drawing
- let drawing = document.getElementById("drawing");
- let context = drawing.getContext('2d');
- context.strokeStyle = "blue";
- context.lineWidth = 1;
- context.beginPath();
- // include helper functions
- // include main methods
- // run all main methods
- ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement