-
Posts
18 -
Joined
-
Last visited
Everything posted by Robert O'Rourke
-
@eyesparky you too! It was really good, very minimal on the instruments, intimate gig
-
Awesome! Need to get back into testing with v2. Had to stick with 1.1.6 to get a project out of the door but super happy to see you're still going strong on development. It's amazing to watch.
-
Hmm. A tileset could well behave differently but I thought you were just checking for overlapping of the 2 sprites? Do you want the sprites to move through the tiles? I know there's a fair bit of a todo list relating to the ninja physics engine. One thing you could try is to enabling a basic type of body for the objects eg. what happens when you use the following?: game.physics.ninja.enableBody( objects.p1 );game.physics.ninja.enableBody( objects.p2 );
-
Hi again, What does your callback function look like? You might need to provide all the arguments for the overlap function eg: function update( game ) { // the 4th argument can be an extra callback to decide whether onOverlap should be called depending on if it returns true or false // the last argument is what 'this' inside the onOverlap callback is set to eg. 'this' or 'game' game.physics.ninja.overlap( objects.p1, objects.p2, onOverlap, null, game );}function onOverlap( p1, p2 ) { // p1 is the first sprite passed in // p2 is the second // example picking up a medikit p1.health += 10; p2.kill();}
-
Do you have an example from the code you're trying? I got overlap detection working but not the process callback.
-
Best way to recreate old physics.overlap() using P2
Robert O'Rourke replied to Robert O'Rourke's topic in Phaser 2
Thanks @valueerror, going to take me a while to figure out P2 fully eg. when to use broad/narrow etc... -
Best way to recreate old physics.overlap() using P2
Robert O'Rourke replied to Robert O'Rourke's topic in Phaser 2
Sorry Arlefreak I should have said I specifically need to use circle collision detection which the Arcade engine no longer has. -
Best way to recreate old physics.overlap() using P2
Robert O'Rourke replied to Robert O'Rourke's topic in Phaser 2
Ok so it seems that P2 may not be ideal for this. I loved the simplicity of the arcade physics engine and the setCircle method, they worked perfectly for me. I'm trying now to use the NINJA physics engine as that correlates much more closely with the way Arcade was working in v1.1.6 eg. it has the same overlap and collides methods and it also is more suitable for mobile device CPUs. I'm finding all sorts of problem with NINJA compared to Arcade though especially when using groups and colliding sprites within those groups. I'll either have to dig through and try to patch up NINJA or beg Rich to reconsider adding setCircle and setPolygon back into the Arcade physics engine! -
Official Phaser 2.0 Book - Looking for feedback
Robert O'Rourke replied to lessmilk's topic in Phaser 2
I'm not convinced a complete reference book is a good idea while the library is still developing. A physical book can end up out of date so quickly so my opinion is that teaching the methodology and approach to actually coding, structuring and organising different types of games is more important. -
Hi, I've just started porting a bunch of games from version 1.1.6 and I'm struggling to work out how to get the same effects using P2 that were pretty straight forward with the Arcade physics engine. Because setCircle() has been removed from the Arcade engine I need to use P2 to make sure my collisions are correct. Here's a snippet from my update loop previously where I was checking if a radar 'blip' overlapped any of the other blips in the this.blips array: this.game.physics.overlap( plane.blip, this.blips, function( blip1, blip2 ) { this.onCrash();}, function( blip1, blip2 ) { return blip1.group.alive && blip2.group.alive;}, this ); So I'm looking at using body.onBeginContact.add() but that seems to cause the sprites to start interacting with each other which I don't want. Any suggestion on how to recreate the above? The physics.overlap method before was so simple!
-
Incorrect game.input.x/y values on click with scaled stage
Robert O'Rourke replied to hackenstein's topic in Phaser 2
I'm still seeing this problem with v1.1.6. It could be because I'm not running the game full screen on its own page though, it's embedded in a webpage. I try the above test case with 1.1.6 and report back. -
I found this playtomic self-hosted backend server and got it set up locally without too much hassle: http://playtomic.org/ When I created it and ran a few API calls I noticed it has tables labelled as 'Ban' lists. I haven't dug through the code much but hopefully it means it has some sort of detection for spammy submissions. You can also be explicit about the Allow-Access-Origin header so the request has to come from your game URL. I know people can still use the console but seeing as you can store game variables on the server it could certainly help. I guess obfuscation and something like playtomic is the way to go.
-
I switched my checkout to branch 1.2 (v2.0.0?) and after building with grunt I still had issues with setCircle() not being defined. Also game.physics.enable() was undefined... Sure I must be missing something as earlier in this thread someone had the same problem. Should I be including the whole library as separate files from the src directory?
-
It's interesting all this. I'm not really bothered about locking down the actual code as it's the intellectual property that's important, plus 'view source' is basically how I learned front end development to begin with! One thing that's difficult to lock down with HTML5 games is folks gaming the system by faking ther scores etc... via the console. Bit annoying if you want to run a leaderboard. That's something I'd like to find a secure solution for.
-
No problem, maybe I misunderstood how the touching property was supposed to work. To be honest I'm new to phaser.js as well!
-
The scaling options didn't seem to help with the spritesheet rendering issue unfortunately. Using separate images seems to work for iOS but isn't really ideal because of the HTTP requests. Sadly edge inspect seems to be playing up so I can't get much useful debug info from mobile safari at the moment. A screenshot might help - there should be one card shown and not 4 so it seems the spritesheet has been been internally scaled down by half somewhere.
-
Hi Rich, I'm actually setting the canvas to the full screen size available once the page loads and then calculating sizes and sprite scaling based on that. I'm guessing there might be a better way! I'll look at the full screen mobile example and see if that helps. Thanks!
-
Hi, I think you need to look at the player.body.touching property. It tells you if the collision was up, down, left or right eg. The following pseudo-code might help you get on the right track. if ( player.body.touching.left ) { // direction to knockback is to the right}if ( player.body.touching.right ) { // direction to knockback is to the left}// landing on an enemyif ( player.body.touching.down ) { // kill enemy OR // calculate direction // player.body.x > enemy.body.x = knockback to right // player.body.x <= enemy.body.x = knockback to left}There is also a player.body.wasTouching property that contains the previous touching data. In case the touching directions are no longer true and you need to know what it was.
-
Hello, I've been making a few proof of concept games to move some old games from flash to html5. I've got a simple Simon memory game using a deck of cards set up here. I've set up a spritesheet for the deck of cards so I can just choose a frame to change the card. The cards are arranged in a row and then in columns depending on how many you show and are scaled to fit into as much of the screen as possible. It works on desktop and android but on iOS devices the frames from the sprite sheet are messed up or just don't show. When they do show it looks like there are exactly 4 of the sprites so I'm guessing it's related to the device pixel ratio. Is there something I can do with Phaser.StageScaleMode to compensate? Thanks!