Jump to content

vmars316

Members
  • Content Count

    431
  • Joined

  • Last visited

Everything posted by vmars316

  1. Hello & Thanks ; I am trying to get a clean compile on the Diagram , I am getting the following errors and I can't figure out what the prob is , Pls help . The Diagram code is at bottom . : Uncaught SyntaxError: Unexpected token { // Detect a rectangular collision between two objects Game.hitTest(a, { return a.x <= b.x + b.width && a.x + a.width >= b.x && a.y <= b.y + b.height && a.y + a.height >= b.y; } : Uncaught SyntaxError: Unexpected token { // Create or destroy cowpies Game.createCowpie =
  2. Thanks , I am getting an "GameObject-Copy.html:163 Uncaught SyntaxError: Unexpected token {" on this: Game.hitTest(a, b { return a.x <= b.x + b.width && a.x + a.width >= b.x && a.y <= b.y + b.height && a.y + a.height >= b.y; } This syntax is new to me , is return supposed to return 'true or false' ? Thanks
  3. <!DOCTYPE html> <html> -<head> <meta name="viewport" content="width=device-width, initial-scale=1.0"/> <meta charset="utf-8" /> <title>Debug Hillary Only</title> http://vmars.us/javascript/GameObject.html --> <style> #assets { height: 0px; overflow: hidden; visibility: hidden; width: 0px; } body { background-color: Black; margin: 0; overflow: hidden; padding: 0; } canvas { cursor: none; } table { color: #E1E1E1; background-color: #732222; height: 24px; width: 600px; border: none; } #buttonsArea { color: #
  4. Thanks This is working ok . . I forgot I needed to reference id="buttonsArea" as #buttonsArea . Thanks
  5. Still trouble with <> code , try this : <!DOCTYPE html> <html> -<head> <meta name="viewport" content="width=device-width, initial-scale=1.0"/> <meta charset="utf-8" /> <title>Debug Hillary Only</title> http://vmars.us/javascript/GameObject.html --> <style> #assets { height: 0px; overflow: hidden; visibility: hidden; width: 0px; } body { background-color: Black; margin: 0; overflow: hidden; padding: 0; } canvas { cursor: none; } table { color: #E1E1E1; background-color: #992D2D; height: 24px; width: 800px; bor
  6. Hmm.. THis sort of worked . <!DOCTYPE html> <html> -<head> <meta name="viewport" content="width=device-width, initial-scale=1.0"/> <meta charset="utf-8" /> <title>Debug Hillary Only</title> <!-- --> <style> #assets { height: 0px; overflow: hidden; visibility: hidden; width: 0px; } body { background-color: Black; margin: 0; overflow: hidden; padding: 0; } canvas { cursor: none; } table, th, tr, td { color: #E1E1E1; background-color: #732222; height: 24px; width: 600px; border: none; text-align: cen
  7. Hello & Thanks ; <!DOCTYPE html> <html> -<head> <meta name="viewport" content="width=device-width, initial-scale=1.0"/> <meta charset="utf-8" /> <title>Debug Hillary Only</title> <!-- --> <style> #assets { height: 0px; overflow: hidden; visibility: hidden; width: 0px; } body { background-color: Black; margin: 0; overflow: hidden; padding: 0; } canvas { cursor: none; } table { color: #E1E1E1; background-color: #732222; height: 24px; width: 600px; border: none; } button {font-size: 16px;} </sty
  8. id.tag : to identify which Target has focus . directionX & Y : to identify which direction Target is moving . Pls, what is your rational for this ?
  9. [Game objects properties and methods] var Thrower = function () { // in future version Thrower will be able to move left and right var self = this; this.idTag = 'thrower'; this.x = (canvas.width / 2) -30; this.y = canvas.height - 64; this.width= 64; this.height = 64; this.visible = true; } var Cowpie = function () { // there can be several cowpies active at same time var self = this; this.idTag = 'cowpie'; this.idActive = true ; this.x = thrower.x; // cowpie will always launch from the s
  10. [The requirements] The requirements would be a description of exactly how the game is supposed to look from a user's perspective, with all the details . The requirements should be what somebody who knows nothing about programming would ask you to make. [There are three rectangle areas on the screen .] [Top of screen] shows game scores: screenSize , Good Hits , Total Shots . [Game area] Below that is a rectangular area where the game plays (game area) [bottom of screen] At bottom of screen there are two rows of buttons , 5 Buttons in all : row 1: "Throw" , row 2: "Pause" , "Play", "
  11. Here is an updated specs docs : 1. The [requirements] The requirements would be a description of exactly how the game is supposed to look from a user's perspective, with all the details . The requirements should be what somebody who knows nothing about programming would ask you to make. [Game canvas] <canvas id="canvas" width="600" height="450" style="background-color:#992D2D"></canvas> [Top of page] shows game scores: screenSize , Good Hits , Total Shots . [sprite Movement] Game will have 2 moving sprites , and 1 stationary sprite , 3 sprites in total] <img id="lie
  12. Hello & Thanks; I usually do all this in my head , but I do see the benefits of writing it all down . 1. The requirements The requirements would be a description of exactly how the game is supposed to look from a user's perspective, with all the details : Game canvas stage: <canvas id="canvas" width="600" height="450" style="background-color:#992D2D"></canvas> Top of page shows game info: screenSize , Good Hits , Total Shots . Screen will show 3 visible sprites: <div id="assets"> <img id="lie02" src="sprites/lies02.png" width="64" height="64" /> <im
  13. Sorry to say "no" . I am learning .js as I go . Is there a predefined structure for a .js game ? I am happy to put it into a more readable format . Thanks
  14. Still no go for Code tag , so i'll just paste code below: <!DOCTYPE html> <html> -<head> <meta name="viewport" content="width=device-width, initial-scale=1.0"/> <meta charset="utf-8" /> <title>Hillary Benghazi</title> http://vmars.us/javascript/_StripHillaryOnly.html http://liesandcowpies.com/javascript/ --> <style> #assets { height: 0px; overflow: hidden; visibility: hidden; width: 0px;-- } body { background-color: Black; margin: 0; overflow: hidden; padding: 0; } canvas { cursor: none; } table { color: #E1E1E1; back
  15. Having probs with Code tag (see below for new code). Thanks
  16. <!DOCTYPE html> <html> -<head> <meta name="viewport" content="width=device-width, initial-scale=1.0"/> <meta charset="utf-8" /> <title>Hillary Benghazi</title> http://liesandcowpies.com/javascript/ --> <style> #assets { height: 0px; overflow: hidden; visibility: hidden; width: 0px;-- } body { background-color: Black; margin: 0; overflow: hidden; padding: 0; } canvas { cursor: none; } table { color: #E1E1E1; background-color: #992D2D; height: 24px; width: 800px;
  17. Hello & Thanks : The full game is here: 1) http://vmars.us/javascript/BenghaziGame.html 550 statements. I have stripped it down to 450 statements here: 2) http://vmars.us/javascript/Hillary-Only-Phone.html . I stripped it down to debug "why it doesn't run properly on a phone" . Both run fine in PC browser . 1) runs on phone , but images get screwed up (on collisions) , often appearing on screen bottom . Game uses interval code , not requestAnnmation . 2) runs on phone , but stops dead on collisions . Game uses requestAnnmation code . Any ideas what I am doing wrong
  18. Foxy Mod ; I still working on your suggestions: You have quite a lot of messy code. Just replace this: With this: It's more readable and more efficient. I am hung up on how to turn tru01 into a function: I tried a few things , like this: But I keep getting this type of error: Uncaught TypeError: tru01.update is not a function I need some help . Thanks
  19. Foxy Mod , Ah , much better : liesandcowpies.com/javascript/measureTimestamp.html Thank You very much !
×
×
  • Create New...