alex_h

Members
  • Content count

    585
  • Joined

  • Last visited

  • Days Won

    4

alex_h last won the day on November 13 2014

alex_h had the most liked content!

About alex_h

  • Rank
    Advanced Member

Contact Methods

  • Website URL
    http://www.alexh.org

Profile Information

  • Gender
    Not Telling
  • Location
    Plettenberg Bay

Recent Profile Visitors

2,080 profile views
  1. Proper way to animate sprites

    When you say 'change the texture of my sprite each frame in the gameloop' don't forget that you also need to consider what your desired frame rate is, and hence how long each frame should be displayed for in milliseconds. Eg, if your animation is meant to play at 25 frames per second, your milliseconds per frame is 1000 / 25, which makes 40. Within the update method of your animation sprite you need to monitor how many milliseconds have passed since the last change of texture, and only once that has reached the threshold of your required frame duration (40) should you then change to the next texture and reset your time counter (subtract 40 from it, not set to zero, otherwise it will drift).
  2. Audio Debugging

    A compressor could also be a good idea, it really depends on what the sound content is. If the waveform has a few peaks that are much higher than the others then using a compressor would be a good way to level those out, they could be potential causes of runtime pops and clicks. But I would still suggest doing so via using a wave editor like adobe audition to modify the source audio file, rather than Web audio processes at run time. You'll likely get better sounding results as well as avoid using up additional cpu cycles unnecessarily.
  3. Audio Debugging

    Yes, a hi pass filter would be ideal. Filter out as much as you can without compromising on the overall character of the sound. You should see the amplitude of the remaining waveform ends up much smaller. If its the summed volume of all your simultaneous sounds thats causing problems then that is a good thing!
  4. Audio Debugging

    It could still just be that you are playing too many loud sounds at once, maybe try reducing the volume in the source audio files rather than reducing it in code. Another common cause of cracking/popping sounds is loops that don't quite loop properly, or have their start or end cut at non-zero amplitude. This is particularly noticeable with low frequency sounds, so as well checking they really do loop cleanly one trick is to eq a lot of the low frequency signal out of your source sounds. I did this just the other day one a game I've been working on to help eliminate pops I was hearing when the game ran on the iPad mini and it worked really well. You wouldn't really hear the low frequencies over the built in device speaker anyway. You might also consider what audio format you are using, I realise you didn't specifically say that loops are a cause of the issue but if that were the case then maybe you are using mp3s? They don't loop properly and will sound glitchy due to inherent flaws in the format, switching to .ogg and .m4a will eliminate that particular problem.
  5. Tiling Sprite artefacts

    Actually there were some other sprites in the same atlas that did need to be scaled at times to lower than 0.5. So in the end I found the best solution was to just remove the tile textures from the atlas.
  6. Tiling Sprite artefacts

    point taken
  7. Tiling Sprite artefacts

    setting mipmap = false on my base textures seems to have immediately fixed the problem with an absolute minimum of hassle! Thanks again
  8. Tiling Sprite artefacts

    Ok cool, I will bear that in mind in the future, thanks
  9. Tiling Sprite artefacts

    Thanks for such a quick response, that is all very useful info!
  10. Tiling Sprite artefacts

    I am using a TilingSprite for the background of a game. Its a top-down view so I'm setting the tiling sprite tilePosition x & y as the player moves around. I'm using a 256px square tile that is in a texture atlas I have generated in texturepacker, and I have set the sprite extrude value to 2 within texturepacker. But I'm still seeing lines appear between the tiles intermittently as I move around in the game. Is there something I'm missing? Would I maybe be better off using an individual image as texture source for the tiling sprite, rather than an atlas subtexture? I have added my tilingsprite source images to my atlas with the intention of minimising the number of calls to upload textures to the GPU, but perhaps a tiling sprite texture should be an exception to this guideline?
  11. Find point on curve

    @m9dfukc I was also thinking about this very issue the other day, very useful - thanks!
  12. Graphics objects and WebGL

    Ok thanks, I'll have a look at the mesh option
  13. Graphics objects and WebGL

    Yes they changed shape, it was an outrun type 'psuedo-3D' game so each road segment was constantly modified for perspective, especially when going around bends. Something like this: If I recall correctly, at the time graphics objects were drawn using the stencil buffer under the webGL renderer, which also meant their edges could not be smoothed. Is this still how it works?
  14. Graphics objects and WebGL

    A while ago I made an outrun type racing game with pixi.js v2.2.9, using graphics objects to render the road and ground polygons. This meant I had to use the Canvas renderer because with the webgl renderer I'd have had to re-upload all the graphics objects to the GPU every frame as they constantly changed shape. I'm now thinking of making a similar game so I just wanted to check whether graphics objects are now rendered differently with webgl in the latest version of pixi? In which case I might be able to modify the vertex positions of graphics objects at run time while running the webgl renderer without worrying about the impact on performance?
  15. stage.removeChild() not working as expected

    It's not a dumb question, don't worry. What you need to know is that a sprite will still exist as long as there is a variable that references it that remains in scope somewhere. So you might remove it from the display list but if there is a reference to the sprite then it still exists, and its x property still has a value of 100. It's just the same as any other javascript object. So yes, you can still console log its properties if you have a reference to it, even after it has been removed from the stage.