• Content Count

  • Joined

  • Last visited

About 1-800-STAR-WARS

  • Rank
    Advanced Member

Contact Methods

  • Twitter

Recent Profile Visitors

1466 profile views
  1. Thanks kevdude, I'd worked it out in the end - had never noticed the 'setMinMax' function in the scaling manager before, so that in combination with resizing the game and offsetting the world co-ordinates to keep things centred did the trick. Cheers.
  2. Hi all, I have a game built in landscape orientation, but there is a lot of dead space around the edges - ie the game elements are all in the centre, and around 40% of the game (ie 20% on each side) is essentially background details that aren't necessary for the game to function. I was wondering if it would be possible to essentially trim the edges off the game while maintaining the central elements when the game is in portrait mode? I was thinking this could be achieved using CSS alone by scaling up the canvas or container element beyond the width of the viewport but I've had no success with that so far, though I reckon it's still possible somehow. Maybe there are some options from within Phaser by resizing the game, if so is there a way to keep the game centred? Cheers!
  3. I see what you mean - I'm focussing mainly on the old Lucasarts style with a character that moves where you click right now. I can see why some may find that cumbersome, but I'm too nostalgic to let it go There should definitely be support for other control schemes as this thing matures though. In terms of having to click exactly on the point on the floor you want to go - the old Lucasarts games would let you click anywhere and move the character to the nearest point on the navmesh. That should be easy enough to do - when the scene is clicked, and no nav polygon is under the mouse, find the nearest one and set that as the destination. I thought about using just collision maps instead of nav maps but I figured there might be weird edges cases. EG say there is, I dunno, a bookshelf between the character and the point you want to go to. With a collision map, the character would walk up to the bookshelf, sort of 'stick' to the edges of it as it moves around it to the target point. With a navmesh system the character would pick a more sensible route that avoids the bookshelf entirely.
  4. OK, I did a bit of hacking over the weekend and started making a pathfinding/navigation system for point n click games. It's by no means a final or even necessarily good approach but it's what I got to after a day or so. http://lewispollard.github.io/phaser-pnc/demo/ You can see faintly on the floor a navigation mesh. You can modify this mesh by pressing D. Clicking will add a point, and pressing Enter will create a polygon out of those points and calculate where the centre point of the poly is. You can press Z to undo the last action (including removing already existing polys). Changing the navmesh will output the JSON for it in the textbox on the right. If a point in the poly overlaps another poly, it will create a path between the two centre points. This creates the graph of linking nodes you see represented by lines. This graph is fed into a Dijkstra's shortest path implementation found here. When you click somewhere in the navmesh, the polygons get iterated over to find which poly the player character is standing in, and which poly is being clicked. It then uses the Dijkstra script to find the shortest path between those two polys. The plugin then essentially creates a chained tween that moves the player sprite to the centroid of each poly in the route. In my local copy it also then moves the player to the exact point clicked but I haven't committed it up just yet as I'm away from my machine. It works! But is pretty janky and quite inefficient, and has some bugs (for example, if you click the poly with index 0 it just straight up tweens to it without following a path. Haven't figured that one out yet!). So if anyone has any suggestions feel free to discuss or submit a pull request or whatever My ideas for improvements: test line intersections for overlapping polys rather than the current way using point intersections. Add points where polys overlap. Move to these points as intermediates rather than moving straight from centre of poly A to poly B. Maybe interpolate the whole path slightly so it doesn't look so much like the sprite is moving along fixed, straight lines?
  5. You should also be able to pass frame names in an array: emitter.makeParticles('atlasName', ['frameName']);
  6. I don't think it's possible to prevent ESC from closing fullscreen. Iirc browsers prevent that keypress (and probably F11) from being halted by Event.preventDefault() so that malicious programmers/advertisers can't prevent people from leaving fullscreen. FWIW if you want to try it I believe the keyCode for ESC is 27. It might work in some but not all browsers.
  7. Double post, I apologise, but I started a document to try and plan this thing out and get it started as I think it could be a great project. https://docs.google.com/document/d/1XKQp-XMvBXb1GgigIqhmJe974W_EEEs6XRF_NqFaLqI/edit?usp=sharing I've made it publically editable so feel free to add any ideas you have and we can get a github repo up soon if people are interested. Edit: Git repo here: https://github.com/lewispollard/phaser-pnc If you wanna get involved PM me here or on github and I'll add you as a collaborator!
  8. I'm still interested! Got too busy with work and never got round to it before, but I'd be eager to collaborate on something like this.
  9. The blur event works fine for me on both Android and iOS Chrome. How are you checking if the events are firing?
  10. You need to add npm/node to your system path: http://www.hacksparrow.com/install-node-js-and-npm-on-windows.html Alternatively there should be an entry in your start menu under the Node folder called 'Node.js command prompt' which will automatically have the path set for that instance of cmd only.
  11. I love you guys. How are you so good at this?
  12. You might have seen the 265 line js raycaster going around recently - I decided to give it a shot myself on this cloudy Sunday afternoon, and implement it in Pixi (as it might be easier down the line to add sprites, use masking, shaders, etc). The code isn't documented at all really and is questionably structured (using browserify modules), but I basically just followed this tutorial while refactoring for convenience along the way, and adapted some bits for Pixi. I'm hoping to improve it further and document it properly, but I think it works quite well for a couple of hours' work. Anyway, here's the demo and here's the code. Arrow keys to move/turn, space to 'fire' (though all that does it play the firing animation ). I've not tested it anywhere other than my laptop in Chrome, so let me know if it runs badly/breaks - it doesn't seem to like Safari, and I've not tried it on mobile at all. If it does run badly, this is a relatively high resolution (800x450) - you can set the resolution in the 'config.js' file, and the FOV is controlled by the 'plane.x' property in camera.js. It runs smoothly in Chrome even at 1920x1080 - though the skybox breaks as it was a last minute addition (should note - textures are ripped from wolfenstein and the skybox is taken from the original demo above)
  13. Also getting cross-origin errors in IE10 in 1.5.2, 1.5.3 and the dev branch - appears to be the bitmap font loader causing the issue, everything else seems to load ok. Each font load triggers a cross origin error and this error in pixi: SCRIPT5007: Unable to get property 'getAttribute' of undefined or null referenceSeems to be when it's trying to get the file attribute from a tag at this line (apologies, only got minified output) var i=this.baseUrl+e.getElementsByTagName("page")[0].getAttribute("file")Context is BitmapFontLoader Hope this is helpful. Cheers!
  14. Interesting, but how does it differ from eg: http://www.free-track.net/english/ or http://facetracknoir.sourceforge.net/home/default.htm