seiyria

Members
  • Content count

    67
  • Joined

  • Last visited

About seiyria

  • Rank
    Advanced Member

Contact Methods

  • Website URL
    http://seiyria.com
  • Twitter
    seiyria

Profile Information

  • Gender
    Male
  • Location
    Wisconsin

Recent Profile Visitors

470 profile views
  1. RT @troyhunt: How to identify a vehicle at risk of collisions: https://t.co/NP0XG9pAWQ

  2. RT @ag_dubs: after posting our new unpublish policy @npmjs saw some interesting pkgs appear in the registry. here's our response: https://t…

  3. Currently, I'm trying to take my 2d array and make a tilemap out of it. Unfortunately, I hit a wall right away, and I can't seem to find any examples of doing this. Here's what I've got: var map = new MapGenerator(pregens.openworld1); var tilemap = new Phaser.Tilemap(this.game, null, 32, 32, map.worldWidth, map.worldHeight); tilemap.addTilesetImage('DungeonA2', 'DungeonA2', 32, 32, 0, 0, 0); tilemap.addTilesetImage('WorldA2', 'WorldA2', 32, 32, 0, 0, 192);where map basically returns my "world" object. I'm trying to add tileset images but it keeps failing. In my preload state, I have this: this.load.spritesheet('DungeonA2', 'assets/sprites/tiles/Dungeon_A2.png', 32, 32); this.load.spritesheet('WorldA2', 'assets/sprites/tiles/World_A2.png', 32, 32);so those keys should definitely exist in the cache, but yet it fails with "cannot read property cache of undefined" on tilemap.addTilesetImage. Any ideas what I'm doing wrong?
  4. Unfortunately this won't work, as my game is entirely procedurally generated.
  5. Has anyone made an auto tiling tool / plugin for Phaser? You can see kinda what I mean by checking out this post here: http://www.saltgames.com/2010/a-bitwise-method-for-applying-tilemaps/ I'm looking at doing this for top-down maps, and if I don't have to implement it myself, that'd be grand!
  6. Would this solution work if the background was not an image, but a tilemap? Can you drag a layer?
  7. Is it possible to add a hover event that displays a tooltip (either made in phaser, or a browser tooltip) based on the type of object you're hovering over?
  8. Hm. I wonder what to do about that then? Should the anchor be set to 0,0? Or maybe I should just make sprites for each rotation, haha. I originally wanted to save on spritesheet usage and just rotate my sprites, which worked for Arcade. Just gave it a roll yesterday with p2 and it does not seem to like that very much.
  9. When I load my entities from a tilemap, some of them are misaligned, for example: (magenta and teal are off a little bit) so I shift these particular objects with x+16, y-4 and I get: (both red) now they're both aligned correctly. My question is, is there some setting I have to change when creating objects? Having these adjustments, and then having to rotate some bodies, is more frustrating than it should be! Nothing seems to line up like it should.
  10. Here is the solution I ended up going with: disappear: -> @body.data.shapes[0].sensor = yes @currentAnim = @animations.play 'fade' if @auto @currentAnim = @animations.play 'fade_once' if not @auto @currentAnim.enableUpdate = yes @currentAnim.onUpdate.add (e) => @body.data.shapes[0].sensor = e._frames[e._frameIndex] isnt 0 @currentAnim.onComplete.add => @body.data.shapes[0].sensor = noset the sensor, update sensor every frame based on the actual frame, and when complete, turn collision back on. Thanks for the help all!
  11. Great! I'm not certain I'll need it, since on average, players will fall through pretty quickly. I'll have to try it out and see how it works.. if it pushes them too far / too fast then I'll work around it. Thanks for this! Seems simple enough, I just wasn't sure what I should be toggling.. P2 has a lot of stuff in it after all.
  12. So I have this object in my project that is "conditionally collidable" -- meaning it can only be collided with when it's in a certain frame of animation. See this gif: http://puu.sh/bvpa2/3e41598204.gif I only want to be able to collide with the block when it's solid... however, if it stops being solid while I'm on top of it, I want the collision to not happen (and consequently I should fall through it). Currently, this is what's happening: http://puu.sh/bvpgM/c521323df1.gif In arcade physics this was pretty simple, just specify a callback for if the collision should happen. I've been fighting with this for a while with p2 and I'm not certain how possible it is.
  13. jdowell pointed out to me that it is possible to handle this in such a fashion: objectGroup = @game.add.group()map.createFromObjects "PlatformLayer", gids.PLATFORM_HORIZONTAL, "platforms", 1, true, false, objectGroup, HorizontalPlatformobjectGroup.callAll "isReady()"Not ideal for every use-case, but it should suffice for most.
  14. Is there a way to pass a callback to this, for when all of the Tiled attributes I set have been loaded onto the object? For example, suppose I set: auto: true distance: 10 on an object, and I want to make use of these in my objects custom constructor that I pass in? Here is my call: @map.createFromObjects 'PlatformLayer', @gids.PLATFORM_HORIZONTAL, 'platforms', 1, true, false, undefined, HorizontalPlatformI'd like it to be: @map.createFromObjects 'PlatformLayer', @gids.PLATFORM_HORIZONTAL, 'platforms', 1, true, false, undefined, HorizontalPlatform, 'isReady'And then, on HorizontalPlatform, I would have an isReady function that could be called when all of the Tiled parameters have been loaded so I don't have to do any weird stuff like setTimeout while waiting for it to finish loading.
  15. As far as I know, it's just that + gravity.