Jump to content

vmars316

Members
  • Content Count

    421
  • Joined

  • Last visited

Everything posted by vmars316

  1. Hello & Thanks, I am trying to get an iframe with no borders without specifying exact width: These aren't working : <iframe seamless height="100%" width="100%" src="buttons_iframe.html" ></iframe> <iframe seamless="seamless" height="100%" width="100%" src="buttons_iframe.html" ></iframe> Pls, what is the proper way ? Thanks
  2. Thanks, I am trying to send a msg (popup window) without a Button. Guess I'll have to do this: document.getElementById("currentLevelLbl").innerHTML = currentLevelLbl + startClockAt ; or maybe a popup-image. Thanks
  3. Thanks Ingolme , I plan to delete the "<body onload = "myFunction()">", and the "<button onclick="myFunction()">msgBox</button>" code. And I want to call "myFunction" from the js code. Is there a way to get pure js to call "myFunction" from within the same page? Thanks
  4. Hello & Thanks, I am getting error msg: jsMsgBoxPlusTinker.html:13 Uncaught TypeError: Cannot read property 'document' of null at myFunction And I can't see my error, need help from someone with better eyes than me, Thanks: <!DOCTYPE html> <html> <title>file:///C:/vmars.us/javascript/SimpleGame-js/ClaustrophobiaGame/jsMsgBoxPlusTinker.html </title> <body onload = "myFunction()"> <p>Click Button to open a msgBox</p> <button onclick="myFunction()">msgBox</button> <script type = "text/javascript" >
  5. Hello & Thanks , Can I call/name video/ogg files *.ogv , instead of *.ogg ? <source src="movie.ogv" type="video/ogg"> <source src="movie.ogg" type="video/ogg"> I have seen it both ways . THanks
  6. Pls , never mind . I think there is something wrong with the video . Thanks
  7. Hello & Thanks , Any idea why this video won't play ? : <!DOCTYPE html> <html> <title>Play .mp4 video http://vmars.us/ShowMe/NotYourAverage-HorseRace.mp4.html : http://www.w3schools.com/tags/tryit.asp?filename=tryhtml5_video_autoplay : </title> <body> <video width="640" height="360" controls autoplay > <source src="NotYourAverage-HorseRace.mp4" type="video/mp4"> <source src="NotYourAverage-HorseRace.mp4" type="video/ogg"> Your browser does not support the video tag. </video> </body> </html> Thanks
  8. Thanks : it takes a long time to figure out the intention behind it. My code is structured according to common theoretical programming models and data structures. You probably should take some college courses because the theory is probably much more than what can be taught in a forum post. Ah , when I google: "javascript common theoretical programming models and data structures" I get a wealth of info , Thanks When I set it up as you say I get an error here: FoxyMod-Game-reset.html:519 Uncaught ReferenceError: game is not defined // Throw a cowpie self.throwCowpie = fun
  9. It creates them , but doesn't yet draw them . Correct ? http://vmars.us/javascript/GameObject/FoxyMod-Game-reset.html I would like you to take a look at the above link , so you can see what I am doing . And also while there , pls rightMouse click to 'view the code' . If you are willing to do that , then I won't need to even Post my code . I have already tried : wrapping the logic section as a function , and executing it at 'load' . Then adding a game.start() immediately after executing that function . Then adding a self.reset() function at the beginning of game.start() . In ga
  10. <!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1.0"/> <meta charset="utf-8" /> <title>Reset</title> --> <style> body { background-color: black; margin: 0; padding: 0; } #assets { display: none; } #canvasDiv { text-align: center; } canvas { cursor: none; } table { margin: 0 auto; color: #E1E1E1; background-color: #732222; height: 24px; width: 800px; border: none; }
  11. Hello & Thanks , Pls , what is this code doing , What does it look like , a separate target1.hillartlies and one for target1.hillarylies ? var target1 = new Target(hillarylies, hillarytrue, 128, 24); target1.speed = 120 / 1000; // 120 pixels per second I tried the things you suggested , but still get bad results . Using console debug , I have a better understanding of what/when the interpreter is doing . I am still stumped with how to code to make a pageReload give the same results as first time running . I put some trace code in there , hoping to understand the code better
  12. These two statements are what I am confused about : 1) Declared functions are not executed immediately. They are "saved for later use", and will be executed later, when they are invoked (called upon). 2) Since a function declaration is not an executable statement, Are 'Declared functions ' executable or not ? Thanks
  13. Good point : I really don't understand the sequence of program execution . How can I track that put a console.log after every statement ? Thanks
  14. A bit confusing here: http://www.w3schools.com/js/js_function_definition.asp Description seems to contradict itself : Declared functions are not executed immediately. They are "saved for later use", and will be executed later, when they are invoked (called upon). Example function myFunction(a, { return a * b; } Semicolons are used to separate executable JavaScript statements. Since a function declaration is not an executable statement, it is not common to end it with a semicolon. Thanks
  15. Thanks , What is the difference between functions coded in different ways : self.setThrower = function(t){ var hitTest = function(a, { function Thrower(s, startX, startY) { Thanks
  16. Thanks I am used to 'var person = { ' 'self.sprites = { ' without the var , threw me . Then Is 'self.sprites = { ' the same as 'var self.sprite = { ' Thanks for the Link .
  17. Thanks , I would like to understand why the self.sprites = { is there . And what is the name of this type of "self.sprites = {" structure . <img id="cowpie" src="sprites/cowpie.png"> // game.sprites.cowpie = document.getElementById("cowpie"); // // HTML elements self.sprites = { background : null, manufacturer : null, cowpie : null }; // // Create a cowpie self.createCowpie = function(x, y) { var cowpie = new Cowpie(self.sprites.cowpie, x, y); cowpie.game = this; cowpies.push(cowpie); }; Thanks
  18. Yes I do . But why does 'document.getElementById("totalScore")' return '<td style="width: 18%"> totalScore </td>' instead of the value of 'document.getElementById("totalScore")' ? And in general what is the purpose of , what is it actually doing: game.scores.totalScore = document.getElementById("totalScore"); ?
  19. on the way to: reset() I don't understand the purpose of // Scores game.scores.totalScore = document.getElementById("totalScore"); console.log(document.getElementById("totalScore")); console.log(game.scores.totalScore); It looks like document.getElementById("totalScore") returns: <td style="width: 18%"> totalScore </td> ?What is the purpose of that? Thanks
  20. Thanks Yes , I'd rather learn Ok , I'll work on this . Thanks
  21. This whole POST is just a side note : I do want to understand your code , and I want you to know that I am not just sitting back and waiting for answers . But I am working at solutions . Ans I did come up with a work around , its ugly , but it works with your original code . I was unable to get working window.location.href and window.open() triggered by a Button . But I did notice that for Browser 'Back and Forward' Buttons game restarts fine . So on a "Play Again !" Button click : code opens up a new webpage called "RestartGame.html" . which runs this code: <
  22. I know your are , Thank you ! (Although , from some of your comments , I was thinking that you thought I was unteachable .) Yes , please do 'hang in there' because I have some questions about your code . Originally Ready to start at "onload" . With changes , at the end of 'setup function' . But when I put game.start there , images disappear .
×
×
  • Create New...