Jump to content


  • Content Count

  • Joined

  • Last visited

About ItsYaBoiWesley

  • Rank

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. I'm going to do a CSS spinner. I know this is a stupid question, but how does one overly such a spinner on top of an HTML5 canvas? That's where my game is. And how do you control it with JS
  2. Nevermind, the problem was in the last line. Instead of clearing all the arrays, it somehow combined them!
  3. Hey guys. I'm using CreateJS to make my javascript game. According to the documentation, objects are layered one on top of the other, in order of their addition to the stage. To control layering, I push to multiple "layer" arrays, and add the objects from those layers. However, it isn't working! Objects that are created first are the ones on the bottom, not objects that are added first. Here's my adding code, as you can see it adds in order of the arrays. for(let a = 0; a < blockLayer.length; a++) { stage.addChild(blockLayer[a]) } for(let b = 0; b < floorLayer.le
  4. Sorry, hate to bump posts... But does anyone have any idea how to do this?
  5. Hi everyone! Coding question incoming... I have a number of loading functions (asset loading, world generation, things like that) and I want to have a loading screen running while loading. Something like a loading spinner or progress bar. But here's the thing, I understand JavaScript is single-threaded. So, how do I do simultaneous visuals and loading? Is there some way to run both tasks in parallel? Can I somehow create a CSS loading spinner and overlay it onto my JS canavs? (I have no experience with CSS) Thanks! -Wesley
  6. Hey, guest sign in didn't work for me. I clicked "Guest Sign Up" a bunch and nothing happened.
  7. Can anyone help me out here? I suppose I need more explicit instruction...
  8. I looked at this code. While I found it helpful, I still don't know the exact line of code that unlocks. What exactly does the unlocking? I'm just confused - JavaScript is still pretty new for me so looking at the Phaser code is a little confusing.
  9. Ok, can you give me an example of an "allow" function to allow this on initialization?
  10. Hi! I've been trying to get my JavaScript game to play sound using the HTML5 audio stuff. I am getting a security error when I run the ".play" method. From my research, this is a new security measure implemented into Google Chrome regarding auto-play on websites. Does anyone know how to get around it? Uncaught (in promise) DOMException: play() failed because the user didn't interact with the document first. I've tried the "SoundJS" and "HowlerJS" libraries. Both of these libraries are rendered inoperable by the new error. The only workaround I've found is making audio play (running
  11. Thanks! I got it now. I added an exportString and importString methods to my classes. They simply take all relevant data about an entity, stick it in an array, and stringify it. Then this data is easy to transport.
  12. Hi! I'm trying to save game data in JavaScript, using "localStorage". I have a class called "Entity" with its own variables and functions. I have an array called "loadedEntities" which contains instances of the Entity class. For example var zombie = new Entity(args) var spider = new Entity(args) loadedEntities = [zombie, spider] I want to save the entirety of "loadedEntities." To do this, I use JSON.stringify(loadedEntities). (I save the entire array in one big gulp) Then, when I want to load the data back into the game, I use JSON.parse(). (My load function sets loadedEntiti
  13. Hi! I'm trying to make a 2D array with a ton of zeroes. For some reason, this does not work. (By does not work, I mean I get errors when accessing the array. If I initialize the array manually, it's smooth sailing.) var blankRow = []; for(var x = 0; x < world[0].length; x++) { blankRow.push(0); } for(var y = 0; y < world.length; y++) { processedWorld.push(blankRow); } It pushes the blank row full of zeroes (the horizontal axis) then pumps that into the destination array (processedWorld, the vertical axis) What am I screwing up P.S. "world" is a
  14. Well, sorry guys! I've changed my entire system 😕 No longer doing color based collision detection, I am rather doing a more conventional system with a genuine tilemap, which is then translated into canvas visual output. Thanks for all of the support, though! I hope someone in the future finds this helpful!
  • Create New...