
jackrugile
Members-
Posts
39 -
Joined
-
Last visited
Everything posted by jackrugile
-
But how would you go about seeking to a specific position? I am temporary holding the currentTime to resume at a later time, but I don't know how to seek to that position.
-
Hey folks, just wanted to share a mini game I made with Phaser in January. I made it for #1GAM. The game is Caviator, an endless cave runner, similar to the old helicopter flash games. Play it Here!
-
I don't have a better solution, but I just wanted to say thank you for posting yours. Been looking for an hour on how to deal with a single object from a tilemap, but apparently no one else has made a game with a single start/finish/hero position, only groups of objects. Frustrating, but your method works great!
-
Hey guys, I finished my entry for js13kGames 2014. It's a simple tower defense game made with JavaScript for game logic and HTML/CSS for rendering. I wasn't able to pack in all of the features I wanted due to size and time constraints, but I am still somewhat pleased with how it turned out. I've always wanted to make a tower defense. It was a lot of fun, but one of the most challenging things is balance. There are so many different things that can be tweaked and tuned and it's tough to do it right. Play Elematter Here
-
Awesome! Where and how do I give you all of my money? I'll do so immediately Might be time for me to finally make a tower defense game.
-
@lewster32 and @theaidem, I have a working example of World.wrap here: http://codepen.io/jackrugile/pen/2609e9765e4e2256f3570481555f45f8 However, I think the @jerome was talking more about wrapping so that you never see the seams or the jump back to the beginning. It seems like there would definitely have to be something a little complicated to get that working. For one, the camera always has to follow the player and cannot be constrained by the actual world bounds. Easy enough with game.camera.bounds = null. However, I think you'd need to somehow create copies of the current world so that you never see the transition. Something like this in this crude rendering: At the point where the camera leaves the true world bounds, it would instantly snap back to x = 0 at the beginning of the actual world. You need the cloned worlds to make the transition smooth. This way, you could run as fast as you want to the right and never see a change, just an infinite looping world. As for how you'd implement this, I have no idea
-
Ok, thanks for looking into this. I'll keep an eye that issue on GitHub. Much appreciated!
-
Shoot, what you're saying sounds right, but I am having trouble implementing it. The examples have some use of RenderTexture, like here, but I don't think there is one that goes through the whole process with getting a graphics object onto a RenderTexture. Do you have any thoughts on how I would integrate my above graphics code into a RenderTexture?
-
I am aware of the method of manually creating bitmap data and using the canvas context to draw. Then, that bitmap data can easily be passed to the creation of a sprite as an image and it works fine. However, I'd like to do the same thing, but with a graphics object. It looks like cacheAsBitmap is a property of the graphics object, but after trying to set it manually, I have no idea where the actual bitmap is being stored so I can reference it. In theory, I am interested in doing something like this with my code: var graphics = this.add.graphics(0, 0);graphics.beginFill(0xFFFF0B, 0.5);graphics.drawCircle(470, 200, 100)graphics.cacheAsBitmap = true;var sprite = this.add.sprite(0, 0, graphics);I realize this is incorrect and doesn't work, but that spells out my intention. Also, once the graphics are created, they would never change, so I wouldn't need to update the bitmap data ever. I found the references to this in the Pixi graphics and display object files, but I still couldn't figure it out. Thanks in advance for replies.
-
This one isn't super essential, but it's all the little bits of polish that have gone into Phaser that make it so great So I will go ahead with this one: I'm not sure how easy this is, or if it is even possible, but I'd love to have the audio decoding process built into the loading process. When loading a lot of audio that you definitely want to be ready, it is nice to show a truly accurate load bar or percentage. At the moment, we can constantly check audio files with this.cache.isSoundDecoded( 'audioKey' ), but that doesn't affect the load bar.
-
How to Increase Rigidity of Arcade Sprite Bodies
jackrugile replied to jackrugile's topic in Phaser 2
Thanks again! Tweens have the advantage of the nice Phaser easings as well -
How to Increase Rigidity of Arcade Sprite Bodies
jackrugile replied to jackrugile's topic in Phaser 2
lewster32, Thanks for your reply. I will look into P2 physics in the future if I ever need perfect stacking. You are right about the matching Candy Crush style game, that is what I was going for and thought it would save me some calculations if I just let the pieces fall with gravity rather than move them manually. Before your reply I actually went down that path with grids and tweens and it works great for this situation. Thanks! That is a clever hack, too! Thank you. -
I was curious if there is a way to increase the rigidity of arcade sprite bodies. At the moment, they seem to overlap quite a bit, and even fall through each other at times. You can see in the gif below (and demo) that a whole row gets lost. Is there any way to completely get rid of this overlapping/fallingissue? If yes, can it be done with arcade physics, or do I need to switch to ninja or p2? Demo of issue here: http://codepen.io/jackrugile/pen/0309643b449e772eba93fc9be3c8e7be/
-
I was dealing with this issue recently. Getting the world to expand as needed can definitely be tricky. I'm sure lewster32's method would work just fine, but I had a hard time wrapping my head around the implementation personally. I found a solution that takes a different approach. The code and demo can be found here: http://codepen.io/jackrugile/pen/fqHtn This method has the camera following the hero as he moves up. His coordinates move up as expected (lower y value the higher you get). The platforms are stationary, and they keep their same coordinates the whole time. This allows you to use arcade physics without having to worry about any trickery to get it looking or behaving right. All entities behave as they would in the real world. Then, the real magic happens with world.setBounds(). With that function, we can adjust the y offset of the world and height of the world. As long as we track how high the player has reached in relation to the starting point, we can use that value to adjust both the y offset and height of the world. It will expand to the exact height we need. As platforms fall out of view, they get recycled and added back above the highest platform that is offscreen. I hope this helps, let me know if it needs any more explanation!
-
It looks like lewster32 answered this recently in this thread: http://www.html5gamedevs.com/topic/7620-draw-solid-rectangle/ graphic.boundsPadding = 0;
-
Thanks Manifest, yeah, that is exactly the method I was talking about. Give that a try genjipress.
-
I had this situation with general canvas use (not Phaser specific) and I found a solution that seemed to work for me. If you add the @font-face rule as you did in your CSS, load it before any JS, and a also put an element on the page with one character and the style set to that font, it should load it before it gets to your JS. So, something <div>.</div>, set the div's font to the custom font, and then just absolutely position it off screen somewhere. I don't think you can use display: none; to hide it, because then the font won't load. Give that a try.
-
Hey, I think you are looking for shutdown(): http://docs.phaser.io/Phaser.State.html#shutdown Rich has a good explanation of all the special reserved functions for states here: http://www.html5gamedevs.com/topic/1372-phaser-function-order-reserved-names-and-special-uses/
-
Good luck to all who are participating. Beneath the Surface!
-
Yeah, I had the same results when messing with that code. It works in the version he is using: 2.0.3 with some patches from 2.0.4, but not in just the plain 2.0.3. As for the difference between the two... I have no idea what is going on there. My guess is it has something to do with calculating the mouse position with respect to the offset of the canvas element, but I'm not sure. Let me know if you find a solution, or just use that patched version
-
26
-
Perfect! Was just about to reply. I tried your code and got the same result with 2.0.0. Glad you got it working with the latest version.
-
Hmmm, I am not sure why that's happening. What version of Phaser are you using? Also, do you have a link to your code? Or could you reply and paste in some of that code?