Jump to content

vmars316

Members
  • Content Count

    431
  • Joined

  • Last visited

Everything posted by vmars316

  1. Hello & Thanks , I am trying to show a log from js to html page . document.write(oneTraceLine + " <br>");} But with the canvas element present , I don't seem to be able to do that . The scaled down code exerpt below is an example of what I am trying to do , but actual js code is much much larger . What can I do to get this puppy working ? I am having trouble getting the <code> tags to work . So , I'll try QUOTES next :
  2. Ah , very cool ! Thanks davej
  3. Hello & Thanks , I can't get this game to end: See lines 118 - 122 else { gameOver = true ; and lines 132 - 135 if (gameOver) { alert('clearInterval = ' + gameOver); clearInterval(draw); } Pls, what am I doing wrong ? <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>Gamedev Canvas Workshop - lesson 7: collision detection</title> <style>* { padding: 0; margin: 0; } canvas { background: #eee; display: block; margin: 0 auto; }</style> </head> <body>
  4. Ok , I see , those are just properties , just a more complex version of below: var person = { firstName: "John", lastName : "Doe", id : 5566 }; While I've got ya on the phone , let me ask : window.addEventListener('keydown', function (e) { myGameArea.key = e.keyCode; } is ' e ' a reserved word ? Also myGamePiece = new component(30, 30, "red", 10, 120); is 'component' a reserved word ? Pls , where can I find a list of all js reserved word ? Thanks again..
  5. Hello & Thanks , I am making my way thru game tutorial - http://www.w3schools.com/games/tryit.asp?filename=trygame_controllers_keys and I would like to know , what is the purpose of a 'name :' label ( canvas : , start : , clear : ) ? var myGameArea = { canvas : document.createElement("canvas"), start : function() { this.canvas.width = 480; this.canvas.height = 270; this.context = this.canvas.getContext("2d"); document.body.insertBefore(this.canvas, document.body.childNodes[0]); this.interval = setInterval(updateGameArea, 20);
  6. Ok davej , I was able to do it two ways , 1) via .html , and 2) via .js . 1) .html way: lines 35 and 84 thru 88 . 2) .js way , lines 35 and 89 thru 91. Running game here: http://liesandcowpies.com/quickjs/BenghaziGame.html Thanks <!DOCTYPE html> <!-- // programName: BenghaziGame.html http://pastebin.com/jPaFjcWk Running online: http://liesandcowpies.com/quickjs/BenghaziGame.html --> <html> <head> <meta charset="utf-8" /> <link rel="shortcut icon" type="image/png" href="icon16.png" /> <script type='text/javascript'
  7. Ok davejI'll give it a shot , & get back to yous , Thanks
  8. Thanks , I moved the code here : </td></tr></table> <script type="text/javascript" src="skel-main-2.js"></script> </body> But it didn't help . Still struggling............
  9. Actually , I Posted it last night , then edited it to empty . Then this morning I checked and there were no answers , so I edited it again , with html code . Guess the Forum keeps the original date Posted , not the last time edited . No probs . I wasn't complaining , just explaining why I was Posting again . Anyways , I do greatly appreciate all the help you folks have given me and others over the years . And I try to give feedback , so yous can see the result . Thanks again ! Here's what I am working on now : www.liesandcowpies.com/testMe/Quickjs/~paddle-index-NOW.html Except
  10. I'm not sure why I haven't received a reply yet , maybe if I put code here instead of pastebin : Here's the html " <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=0, width=device-width"> <link rel="shortcut icon" type="image/png" href="icon16.png" /> <!-- try here: --> <script src="quick.js"></script> <script src="skel-main-2.js"></script> <!-- --> <style> #assets { height: 1px; overflow: hidden; visibility: hidden; w
  11. Hello & Thanks , I am learning from this example : http://www.w3schools.com/tags/tryit.asp?filename=tryhtml5_ev_onclick I want to put the .js in a separate file , <script src="skel-main-2.js"></script> instead of within the .html . Code is here : quick.js: www.liesandcowpies.com/testMe/Quickjs/quick.js (if needed) html: http://pastebin.com/EQUTDd4y js: pastebin.com/HXbrb86M I want to put the .js in a separate file , <script src="skel-main-2.js"></script> instead of within the .html . But when I run it , up comes
  12. Oops , I see my error : I need a separate document.getElementById('item#').innerHTML = for each item# . Thanks
  13. I couldn't get the crazy thing working so I did this instead: <div> <table style="width:100%"> <tr> <td width="10%"> totalScore = </td> <td id="totalScore" width="5%"> </td> <td width="8%"></td> <td width="10%"> oops! = </td> <td id="oopsScore" width="5%"> </td> <td width="8%"></td> <td width="10%"> totalHits = </td> <td id="totalHits" width="5%"> </td> <td width="8%"></td> <td width="10%"> totalShots = </td> <td id="total
  14. Thanks , this is what i am trying to get to run : document.getElementById('keepScore').innerHTML = ' player2Score = ' + player2Score; but when I get this to work , i will have 4 players , player1 -player4 .
  15. Hello & Thanks , var player1Score = 10; var player2Score = 20; document.getElementById('keepScore').innerHTML = ' player2Score = ' + player2Score; I want to be able to display several items on one line with the above code or preferably something that works . Pls , how can I do this . Thanks
  16. Thank you very much guys ! Both this : <script src="..\..\lib\Phaser.js"></script> And this : <script src=".\..\..\lib\Phaser.js"></script> WORK !
  17. Thanks , I have been all around with google . Some stuff contradicts other stuff . Anyways , of the following 3 ways , only the first one works . <script src="C:\Phaser\phaser-2.4.4\DownloadExamples\phaser-examples-master\examples\lib\Phaser.js" type="text/javascript"></script> <!-- <script src="/examples/lib/Phaser.js" type="text/javascript"></script> --> <!-- <script src="\examples\lib\Phaser.js" type="text/javascript"></script> --> I must be missing something , help me out here . Thanks
  18. Hello & Thanks , I have an .html file here : C:\Phaser\phaser-2.4.4\DownloadExamples\phaser-examples-master\examples\arcade-physics\asteroid-movement\asteroids-movement.html that points to a .js file here : <script src="C:\Phaser\phaser-2.4.4\DownloadExamples\phaser-examples-master\examples\lib\Phaser.js" type="text\javascript"><\script> The prob for me is that the \lib Folder which contains the .js is not in the Path of .html . Other than moving the \lib Folder , How can I shorten the Path reference to \lib\ Phaser.js ? I suspect its some combinat
  19. Thanks : Yes , I am beginning to understand that I wonder how Enchant.js does it then . It works great ! Trouble is , they stopped updating it . Oh , here is a working example : http://liesandcowpies.com/testMe/~cat-source-WIP-experiment.html That means that no one can do a "save as" for the page above and have it run on their computer , Unless they specify saveAs "html only" option , and then to run it they must be connected to internet . justsomeguy , Thanks for sticking with me . ..Vern
  20. Hello & Thanks , No probs getting an image file off internet or server with javascript, BUT Getting a LOCAL image file with javascript causes an "File access violation" . No problem with html5 getting a LOCAL file : <div id="images"> <br><img id="truth02id" name="truth02png" src="truth02.png"> </div> But If I use either of the two javascript code below , the browser considers it an "File access violation" : // Add our image as a sprite // OR loader .add("images/truth02.png") .load(setup); I have seen examples of
  21. I am running pixi.js To get html to run i user would have to : In chrome , I have to add command line switchw=es , "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --allow-file-access-from-files In IE , i have to click on the BLOCKED button So i was thinking , i could load image fine with html *.png and then grab it in js from html , maybe something like document.GetElementById . But I don't know how exactly to write that code . Possible ? Thanks..vm
×
×
  • Create New...