SlimTim

Members
  • Content Count

    9
  • Joined

  • Last visited

  1. I have some trouble using the RenderTexture. I'm making a side scrolling game with procedural map generation. At this point I've got a working prototype of the map rendering, but it keeps adding new images, thus clogging the memory. Ideally I want to kill any image that reaches a negative x-value and revive new map tiles just outside the canvas (in the positive direction). At this point I'm wokring with my images via a group. Why RenderTexture? Well, since the map generation is randomized, I need to change the (sheet) frame of the image upon revival in order to change the map, RenderTexture seems perfect for this using loadTexture([image], [random frame]) Is it? How exactly do I initialize a RenderTexture with an arbitrary amount of frames? Do I ned to initialize an Image first (which references the tilesheet), then pass it to RenderTexture? How do I identify which individual Image is placed in the negative x-values Honestly, I'm not even sure if you people can decipher what I'm asking for, so to make it really short and concise: I need to kill images in the negative x-space, revive them in the positive x-space (just outside the canvas) and then change their frame.
  2. I have successfully implemented a map generating algorithm that generates part of a map before the player reaches it. I add the new part of the map after the last made part: nextMapTileXValue = streets.getAt(streets.length-1).x + tileWidth;Now, nextMapTileXValue keeps rising when I move the player to the right. streets.getAt(streets.length-1).body.xSeems to return the coordinates within the game canvas itself, not the entire game universe (IE: never exceeding game.width). Now, how come player.x and player.body.x is always within game.width? Shouldn't player.x rise in conjunction with nextMapTileXValue?
  3. I realized that I need to set the velocity of the player in order to move, but that requires adding physics to the player which is pointless since no physics is used in the game. Is there a way to emulate velocity without adding physics?
  4. I just encountered this too. Indeed, setting the bounciness to something arbitrarily small fixes it.
  5. SlimTim

    Ridiculous CPU usage?

    I upgraded to 13.10 which seems to have fixed the problem, upgrading my GPU drivers in the process. Thus, rich would seem to be right.
  6. SlimTim

    Ridiculous CPU usage?

    So, I've begun fiddling with the tutorial example, but noticed that my fan was running a lot faster than it usually does. I checked the system monitor and noticed a CPU usage of around 50-60% when running the game code. This happens in both Firefox and Chrome. Is this normal? Any workarounds? It even slows down my code editor and other tasks. Sometimes it freezes for about 10 seconds, then continues but leaves the computer in a very sluggish state. - Scrolling vastly slowed down, programs shut down very slow etc. What is even more disconcerting is that nothing in the system monitor indicates any resource hog after I shut the browser down, yet the problems persist until I reboot. PS: I run Ubuntu 12.04 on a a i5 quad-core 2.5 GHz, 4 GB RAM. Bonus question: When upgrading from 1.1.3 to 1.1.5 gravity seems to get botched resolving A LOT slower than it should (and does in 1.1.3). What gives?
  7. So, I'm looking through the keyboard docs in order to find a function for buttons being pressed as opposed to being held down. Say I'm firing a bullet, I only want one bullet spawned per button press, regardless of how long the button is held down. I have achieved this with raw JavaScript earlier using a boolean: isButtonADown = false;if(buttonA){ if(!isFiringButtonDown){ console.log("Shot fired."); isFiringButtonDown = true; }}else{ isFiringButtonDown = false;}Is there anyting like this implemented in Phaser?
  8. I forked Phaser, local server up and running, everything's snazzy. Now, where do I place my game?