Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. ```javascript
  2.  
  3. //main.js
  4.  
  5. //main body of code is inside here
  6.  
  7. //this is the main code
  8.  
  9. //INITIALISE OBJECTS
  10.  
  11. let player = {
  12. lives: 10,
  13. }
  14.  
  15. let game = {
  16. alphabets: ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h',
  17. 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's',
  18. 't', 'u', 'v', 'w', 'x', 'y', 'z'],
  19. word: {
  20. name:result_word.toLowerCase(),
  21. definition:result_definition,
  22. get wordLetters(){
  23. return stringToList(this.name)
  24. }
  25.  
  26.  
  27. }
  28. }
  29.  
  30. // keep track of true and false guessed
  31. game.correctList=[]
  32. for (var i=0; i<game.word.name.length; i++) {
  33. game.correctList.push( false);
  34. }
  35. //decided not to use a getter
  36.  
  37.  
  38. //set up drawing
  39. let drawing = document.getElementById("drawing");
  40. let context = drawing.getContext('2d');
  41. context.strokeStyle = "blue";
  42. context.lineWidth = 1;
  43. context.beginPath();
  44.  
  45.  
  46. // include helper functions
  47.  
  48. // include main methods
  49.  
  50. // run all main methods
  51.  
  52.  
  53. ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement