Tilde

Members
  • Content count

    119
  • Joined

  • Last visited

About Tilde

  • Rank
    Advanced Member

Contact Methods

  • Twitter
    WillTheSixth

Recent Profile Visitors

1,883 profile views
  1. Phaser 3 Beta 4 Released

    If I'm working on a huge Phaserv2 game in which optimization is going to be important going forward, is it worth it to change the whole thing up and make it v3 for the performance updates?
  2. WebGL performance on Chrome

    This seems to be a recent development and I want in on this question
  3. Shoot a rope

    I actually think you shouldn't use Phaser.Rope for this. What you're trying to accomplish for the "rope" part of the entity can easily be done with a simple tilesprite that expands in height over its lifetime, with the spearhead being a "child" to that sprite with its Y offset updated to be half its height. I hope that makes sense, but basically, you'll be using game.add.tilesprite, game.add.sprite, and you'll be calling rope.addChild(spear).
  4. The thing I'm trying to create is this: I have a gamestate called a GameArea, which defines every playable space in the game, sort of a basic "Gameplay" gamestate. So we know that for every GameArea, I want to load the same HUD elements, player, etc., but I want to load different tilemaps and music depending on which area it is. So the idea is to call the base Load function first, followed by the Load function of the unique child state. I haven't been able to get any version of this to work yet, I'm having trouble creating something that'll play well with how Phaser calls the functions. Anyone have any ideas? The only other thing I can think of is making functions like loadGameAreaAssets() and createGameAreaBase() that I call for every gamestate, but that's maybe a little less clean.
  5. Maximising game viewport?

    So this is weird, but my current solution doesn't even use scaling options, because I want my game to put certain elements relative to the edges of the screen. So I ended up with this in the update loop: if (game.width != window.innerWidth || game.height != window.innerHeight) { this.resizeScreen(); } And that looks like this: resizeScreen: function() { game.scale.setGameSize(window.innerWidth, window.innerHeight); game.world.setBounds(-game.width / 2, -game.height / 2, game.width, game.height); game.camera.focusOnXY(0, 0); game.scale.refresh(); console.log('Screen resized: ' + game.width + 'x' + game.height); /* this.test = game.add.sprite(0, 0, this.solidRectBmd); this.test.anchor.setTo(0.5); this.test.width = 100; this.test.height = 100; this.test.tint = 0; */ }, Just as valid hopefully?
  6. Maximising game viewport?

    Currently working on this myself. The margin is because HTML bodies have a natural margin you have to get rid of: body { width: 100%; height: 100%; margin: 0; padding: 0; background-color: black; } #container { width: 100%; height: 100%; margin: 0; padding: 0; } Beyond that, RESIZE doesn't actually resize for me. EXACT_FIT does, but that also stretches the elements, which we don't want.
  7. Why does this happen On Phaser Tiled example code?

    The link is missing!
  8. onMarkerComplete has been broken since 2014.

    I'll probably do that from now on instead of my current strategy of commenting "god damn it, Rich" everywhere I use audio
  9. game.bgm = game.add.audio('southSide'); game.bgm.addMarker('start', 0, 11.748, 0.7); game.bgm.addMarker('loop', 11.748, 110.769, 0.7, true); game.bgm.play('start', 0, 0.7, false); game.bgm.onMarkerComplete.add(function() { // This will only fire once, and the sound will NOT loop after heading into the loop section under any circumstances if (game.bgm.volume != 0.0) { console.log('yes'); game.bgm.play('loop', 0, 0.7, true); } }, this); I did a search on this and it turns out it's just never been fixed!
  10. The gamepad buttons do not respond with the game on pause

    Adding gamepad support to my game, and I'm pretty sure this is still a problem.
  11. I cannot for the life of me figure out why it turns into a giant, thinly-stretched column upon exiting frame 1. Even if I set its initial frame to 4 or something and I tell it not to update frames and then apply the filter, it works fine. I also can't figure out how to get the texture to cleanly connect to its edges in the same way before I used a bmd...but at least this is closer.
  12. Thanks for the info! I'm trying and getting some weird results, no luck yet with a direct transfer. My backgrounds have blank backgroundImage, backgroundTileSprite, and backgroundBmdImage objects that I load textures onto depending on the encounter. Here is what the battle background object looks like: create: function(gamestate) { // Shader by Kali (https://www.shadertoy.com/view/4dfGDM) // I slightly modified it! ~Tilde var fragmentSrc = [ "precision mediump float;", "uniform float time;", "uniform vec2 resolution;", "uniform sampler2D iChannel0;", "void main( void ) {", "vec2 uv = gl_FragCoord.xy / resolution.xy;", "uv.y *= -1.0;", "uv.x += (sin((uv.x + (time * 0.5)) * 10.0) * 0.1) + (sin((uv.x + (time * 0.2)) * 32.0) * 0.01);", "vec4 texColor = texture2D(iChannel0, uv);", "gl_FragColor = texColor;", "}" ]; gamestate.backgroundImage.loadTexture('mother3BG', 0); gamestate.backgroundImage.x = gamestate.world.centerX; gamestate.backgroundImage.y = gamestate.world.centerY; gamestate.backgroundImage.anchor.setTo(0.5); gamestate.backgroundImage.scale.setTo(3.6); gamestate.backgroundImage.fixedToCamera = true; gamestate.backgroundImage.visible = false; gamestate.backgroundImage.animations.add('natural'); gamestate.backgroundImage.animations.play('natural', 7, true); var gray = game.add.filter('Gray'); var customUniforms = { iChannel0: { type: 'sampler2D', value: gamestate.backgroundBmdImage.texture, textureData: { repeat: true } } }; var filter = new Phaser.Filter(game, customUniforms, fragmentSrc); filter.setResolution(900, 600); gamestate.backgroundBmdImage.filters = [filter, gray]; }, getFilters: function() { return null; }, update: function(gamestate) { gamestate.backgroundBmdImage.filters[0].update(); gamestate.backgroundBmd.draw(gamestate.backgroundImage); },
  13. I modified the sine wave filter from the examples ( http://phaser.io/examples/v2/filters/sinewave ) to create the background for this battle: http://www.hardmodeorders.com/vandal/vandal.php It works great, but that 256x256 texture originally comes from a sprite sheet, which I wanted to animate as it was being warped by that. Obviously, when you add more frames to the image, it's no longer a power of two, and it breaks the filter. Is there a way to reconcile this? What you see: What I want to use:
  14. Phaser 2.5.0 Released

    Thanks!
  15. New typewriter effect script

    This is great, the new update really helps. I'd love to see a feature where text can take a special character to "pause" like you see in RPGs. Like... "Well, (PAUSE) I guess I'll see you later." (END LINE)