Rembrandt

Members
  • Content Count

    8
  • Joined

  • Last visited

About Rembrandt

  • Rank
    Newbie

Profile Information

  • Gender
    Male
  • Location
    The Netherlands
  1. While experimenting with the Web Speech API I created this little game. It looks like those word typing games but now with voice control Have fun! https://saytheword.io
  2. Hi guys, I'm struggling with this problem for a couple of days now. When I touch an element in my game I'm playing a sound effect. I want this effect to play instantly when i touch this element. The problem is there is a small delay (like 200ms) when i touch this element on my phone (Samsung Galaxy S4). I tried everything, SoundJS, Howler, custom Web Audio API code, but the problem persist. Im building my game with IntelXDK and Crosswalk. The problem only occurs on mobile, on desktop there is no delay. Could anyone help me with this problem or has some info? Or maybe could some other HTML-5 mobile developer give me some help with a good solution to use sounds in my game. Thanks!
  3. To spawn an enemy in a random location at regular intervals you could do something like this. var stageWidth = 1000; var stageHeight = 1000; var intervalInMilliseconds = 5000; var enemies = []; var enemyWidth = 50; var enemyHeight = 100; function spawnEnemy(){ console.log('Spawn a new enemy!'); // Generate a random x position. var randomXPosition = Math.floor(Math.random() * (stageWidth - enemyWidth)) + 1; // Generate a random y position. var randomYPosition = Math.floor(Math.random() * (stageHeight - enemyHeight)) + 1; //Create a new Enemy instance and use above coordinates to place it in a random spot. //Fill the rest of this object like you did with var bullet = {...}. var newEnemy = { xPosition: randomXPosition, yPosition: randomYPosition }; // Push your new enemy in the enemies array so you can render them all at once in the draw loop. enemies.push(newEnemy); } //This function will run 'spawnEnemy()' every 'intervalInMilliSeconds'. setInterval(spawnEnemy, intervalInMilliSeconds); I hope this clears things up, otherwise I'm glad to help you further.
  4. Well it's an OO pixi.js project so jsfiddle is out of the question i guess. But the game is almost finished, few more days. I will send you a link when I am done okay? ^^
  5. Thanks Azrael! Your first solution with PI works like a charm. But now i have another problem, i would like the particles to travel in a certain region (a slice from a circle). For example a region (0 degrees to 210 degrees). I hope you can help me out, thanks ^^
  6. Hi guys, I'm no math genius so here is my question. How do i create a particle explosion where each particle moves to a random direction with the same speed? There is probably a simple solution but I can't figure it out. Thanks! So like in pseudo-code: for(100){ particle.xVelocity = Random particle.yVelocity = Random particles.push(particle) // This array now contains particles that move in a random direction with the same speed }
  7. Hi, this is my scenario. I have a particleContainer as parallax background for my game. But i want the rest of the game to render in a normal container. But i can only see the particleContainer. It looks like the containers overlap each other. I already tried using transparency but it's not working. So is it possible to create a game with a particleContainer as background and a normal container for the player/enemies etc. ? Thanks. -EDIT I fixed it. Just add the particleContainer as a child to the normal container.