
RestingCoder
Members-
Posts
47 -
Joined
-
Last visited
Everything posted by RestingCoder
-
Don't get me wrong, I look forward to 1.2. I'm just disappointed with a release being completely useless. It should have stayed in the dev branch. I mean, at this point, any new user of Phaser will be using a broken framework without even knowing it. I'm excited for 1.2, and will be glad to be rid of these physics bugs when it is released and working.
-
I agree, this is disappointing. I've been working a dev version of 1.1.4 from before it was considered done due to the physics issues because I need the Tilemap features.
-
Yeah. If I ever need to have a way of keeping data if a player clears their browser cache, I'd probably use mongodb or another database option and a unique key for each player so they can load data that is saved on the server.
-
I tend to just use localStorage, myself.
-
You may also want to change which post is marked as the answer for this thread.
-
Thanks, Rich. jcs, I'll try that next time I am at the computer. Thanks.
-
minVelocity was already set as a test, and I have tried adding various values for linearDamping. Interestingly enough, if I set the bounce at all (no matter the value), the player sprite will stop moving entirely if it touches any walls. I am also seeing an issue where the sprite is not dropping like it should. To reproduce this, use the up arrow in the example I linked previously, and land on any of the platforms that aren't what you would consider the floor. Now, move left or right, off the platform. You will basically be stuck in the air until you move along the y axis again. I really have no idea what is going on here, but all of this works perfectly with what was in the dev branch up until a day or two ago.
-
I have been using the dev branch for a couple weeks, and everything was going well. Now, I have switched to the release version of 1.1.4, and made what I believe are all the changes needed to make things work. However, for something as simple as causing my player sprite to jump, it does not work. This code snippet is for my player class, extended from sprite: console.log(this.body.onFloor()); if (this.jumpButton.isDown && this.body.onFloor() && this.game.time.now > this.jumpTimer) { console.log('beep'); this.body.velocity.y = -720; this.jumpTimer = this.game.time.now + 250; }'beep' is triggered, but the sprite does not move. At all. I have also found that this code only works if I am already moving horizontally if (this.arrowKeys.up.isDown) { this.body.velocity.y = -400;}You can see an example of this here: http://play.reminiscencegame.com/example2/
-
I would personally do this using the createFromObjects Tilemap function that is in 1.1.4. You could simply add your objects in your map inside Tiled, export the JSON, and load it like you normally would. The way you would use this function is below: map.createFromObjects('Object Layer 1’, 5, ‘coin', 0, true, true, coins); Here you can see the doc comments and the signature of this function from within the Phaser source as well: /** * Creates a Sprite for every object matching the given gid in the map data. You can optionally specify the group that the Sprite will be created in. If none is * given it will be created in the World. All properties from the map data objectgroup are copied across to the Sprite, so you can use this as an easy way to * configure Sprite properties from within the map editor. For example giving an object a property if alpha: 0.5 in the map editor will duplicate that when the * Sprite is created. You could also give it a value like: body.velocity.x: 100 to set it moving automatically. * * @method Phaser.Tileset#createFromObjects * @param {string} name - The name of the Object Group to create Sprites from. * @param {number} gid - The layer array index value, or if a string is given the layer name, within the map data that this TilemapLayer represents. * @param {string} key - The Game.cache key of the image that this Sprite will use. * @param {number|string} [frame] - If the Sprite image contains multiple frames you can specify which one to use here. * @param {boolean} [exists=true] - The default exists state of the Sprite. * @param {boolean} [autoCull=true] - The default autoCull state of the Sprite. Sprites that are autoCulled are culled from the camera if out of its range. * @param {Phaser.Group} [group] - Optional Group to add the Sprite to. If not specified it will be added to the World group. */ createFromObjects: function (name, gid, key, frame, exists, autoCull, group) This can be very useful, as it allows you to create a group of sprites, which you can interface with in the same ways you can with any other group inside Phaser. This means you can check the collision and perform a function on the specific object that was collided with. This works just like any other group: this.game.physics.collide(player, coins, this.addMoney, null, this); … addMoney: function (p, i) { player.money += this.game.rnd.integerInRange(1, 5); i.destroy(); }
-
This could also be useful: http://gametest.mobi/phaser/examples/_site/view_full.html?d=physics&f=angle+between.js&t=angle%20between
-
I was extending Tilemap in a similar fashion as you'd do with Sprite, and the map wasn't actually accessible from the game, where I was trying to destroy it. I fixed it by moving some code around. Sorry for the waste of time. Thanks, as always, for what you do.
-
Sprite jitter & making bitmapText fixed relative to camera
RestingCoder replied to Mariusz's topic in Phaser 2
To fix a bitmapText to the camera, you can create an empty sprite, fix it to the camera using containerSprite.fixedToCamera = true, then add the bitmapText as a child with containerSprite.addChild(bitmapText) I believe follow is currently being worked on.- 3 replies
-
- bitmaptext
- text
-
(and 1 more)
Tagged with:
-
Hey Rich, I'm not seeing a way to delete this thread, so can you delete it? This was caused by a stupid mistake on my part that most people will never run into, and I don't want to cause any confusion. Thanks!
-
They are definitely still there. After the 7th map load (on my laptop) the frame rate drops by around 5, and does so for each subsequent map load until it is in single digits, and memory usage just keeps going up. I've checked memory usage on every other object I am creating, and it only seems to happen with phaser.tile. I am probably just doing something wrong when destroying the map and creating the new one, but I just can't figure out what in the world is causing it after playing with it for a few days.
-
Unfortunately, that doesn't appear to be working either. (I made the change locally, so it isn't in the code I linked above) EDIT: It may be something to do with the way I am creating the maps, but I don't seem to be having this issue with anything besides tiles.
-
Can someone provide an example of everything needed to destroy a Tilemap? Visually, I am not having trouble with it, but there are a ton of Phaser.Tile objects in the heap when I switch levels/maps. I have tried so many things, and have checked the source in the dev branch for the last few days, and can't seem to be able to get this to stop, no matter what I try. Any thoughts would be greatly appreciated. If you'd like to see code, check here: http://play.reminiscencegame.com.
-
I am seeing some collision issues with Tilemaps. I have something setup to show what I mean here: http://play.reminiscencegame.com/example/ If you move left/right into a wall, sometimes there is a gap, and sometimes there isn't. There also appears to be a 1px gap between the character and the floor. From what I see here, it looks like this will be fixed, but I just wanted to provide an example. EDIT: I have also had things get stuck like in the screenshot attached.
-
[double post]
-
Tweening section here: http://gametest.mobi/phaser/examples/
-
The code cost for flipping a sprite is so incredibly tiny relative to having a sprite sheet that is twice as big. Just scale the sprite to -1 in the code.
-
Thanks I plan on adding a couple more things then spending the rest of the jam making more levels.
-
If you want, you can add what I am working on until the 10th of this month for a game jam. Http://reminiscencegame.com/gbjam
-
I feel like I may be missing something, or some planned features were cut at some point, as I see mentions of this around the forum, but nothing in the code itself. Is it currently possible to use shapes for collision? Whether they are circles, or hard coded polygons made with lines or anything? Any ideas would be great as well, since I am willing to use a temporary solution currently. Thanks!
-
I actually really like that as well. I would personally prefer being able to move up/down with my arrow keys or W/S, but it was cool either way.