samid737

Members
  • Content count

    14
  • Joined

  • Last visited

1 Follower

About samid737

  • Rank
    Member
  • Birthday February 12

Profile Information

  • Gender
    Male
  • Location
    The Netherlands
  • Interests
    Game development, Unity3D, HTML5, aerospace, drawing, helping others out when they don't get something

Recent Profile Visitors

97 profile views
  1. I found this post after reading your question... http://stackoverflow.com/questions/31905938/projection-math-in-software-3d-engine I dont think there are any plugins at the moment for Phaser, but the above might be a fine starting point. Could be useful and its within phaser. I have never worked with Three.js or any 3D HTML5 engine, but have you considered PlayCanvas?
  2. Thats a great idea (probably more practical too). Reminds me of the old Mortal Kombat series (uppercut punching to a new stage):p... for the map design: maybe different "food genres"? At any rate, nice work!
  3. Very cool game i like it! You could add something like saving abilities and skins and such, maybe new maps with elevation differences (more calories you have higher you can jump lol)?
  4. by the way you don't really need the invisiblebodies group that I added in example2..(that was for example1, again I updated the code above)...
  5. I just updated my reply, I think it should be what you needed now... I forgot that the bodies themselves dont remain tangent to the centrepoint (in the arcade example). the second example sould be oke?
  6. Hi,I was looking for solutions for the exact same problem not a while ago. If you are just looking for a way to rotate a group of sprites about a pivot : https://phaser.io/examples/v2/sprites/pivot I have worked out an example for you if you want to use arcade physics bodies that rotate about a centrepoint: here is a test: http://54.87.189.59/example/ If you want to use P2 physics and keep the bodies tangential, you could use lockconstraints: http://54.87.189.59/example2/ if you need the javascript source: var game = new Phaser.Game(800, 600, Phaser.CANVAS, 'phaser-example', { preload: preload, create: create, update: update, render: render }); function preload() { game.load.image('arrow1', 'assets/sprites/arrow1.png'); game.load.image('arrow2', 'assets/sprites/arrow2.png'); } var arrow1; var arrow2; var pivotpoint; function create() { game.stage.backgroundColor = '#3e5f96'; game.physics.startSystem(Phaser.Physics.P2JS); pivotpoint=game.add.sprite(300,300); arrow1 = game.add.sprite(300, 300,'arrow1'); arrow1.anchor.x=0.5; arrow1.anchor.y=0.5; arrow2 = game.add.sprite(400, 200,'arrow2'); arrow2.anchor.x=0.5; arrow2.anchor.y=0.5; game.physics.p2.enable( [arrow1,arrow2,pivotpoint]); pivotpoint.body.static=true; game.physics.p2.createLockConstraint(pivotpoint, arrow1,[150, 0], 0); game.physics.p2.createLockConstraint(pivotpoint, arrow2,[0, 150], 0); arrow1.body.debug=true; arrow2.body.debug=true; pivotpoint.body.debug=true; } function update() { pivotpoint.body.rotation+=0.05; } function render() { game.debug.body(arrow1); game.debug.body(arrow2 ); game.debug.body(pivotpoint); game.debug.geom(new Phaser.Point(pivotpoint.x, pivotpoint.y), '#ffff00'); }
  7. Hi, I am making my first mobile HTML5 game using Phaser. Its a very simple tap game where you have to keep your character balanced. I have noticed something that is kind of strange to me. I have tested the game on: -iphone 5c, IOS 10.2.1, safari browser. -iphone 5s, IOS 10.2.1, safari browser. -Samsung Galaxy S4, android 4.4.2. I have tested the game using CANVAS mode and WEBGL mode for comparison. I observed the following: CANVAS mode: Iphone 5c < Iphone5s ---> 30fps vs 60fps avg. -----> expected this.... S4: 60fps. WEBGL mode: Iphone 5c > Iphone5s ---> 60fps vs 30fps avg. -----> did not expect this.... S4: 60fps (same). My expectation was that the 5s would play at 60fps in WEBGL mode, but it is the opposite case. On the samsung s4 it performs the same for both. In CANVAS mode, I have 15-17 draw calls . In WEBGL mode this reduces to 9 draw calls (Most of my objects are on a single atlas). I still have to add audio to the game. I can imagine that it is hard to tell what might be going on, but I can't really find a reasonable explanation for this result and its kind of dissapointing. It seems to me that I can't get a reliable result using WEBGL.... I'm thinking of sticking to CANVAS mode and optimize as much as I can. Would this be the right way to proceed?
  8. @drhayes very interesting!
  9. Looks very strange, maybe you could inspect the collision bodies? https://phaser.io/examples/v2/arcade-physics/body-debug But it definitely looks and smells like a glitch:p...
  10. are you using P2 physics? I think in P2 physics you need to explicitly state to allow the body to be rendered: hero.body.debug=true; http://phaser.io/docs/2.6.2/Phaser.Physics.P2.Body.html#debug
  11. @feudalwarsI think his requirement for a perspective projection requires more effort, skewing and scaling are affine transformations and can be done with the answer provided by @samme, but projection is not I believe .. Correct me if im wrong though:p.. https://en.wikipedia.org/wiki/Transformation_matrix#Perspective_projection But switching to isometric view could be an alternative solution.
  12. I can imagine it involves some math if you want to project 2d top to 3d perspective view . I found this, it could help but im not sure: https://bl.ocks.org/mbostock/10571478 As you can see a lot of math involved and probably overkill, but its something..
  13. @mattstyles I see yes, seems like an interesting, but difficult task to implement by myself for now. Thanks for your input in any case! @Tom Atom I think this will work and it could be useful for more purposes, like blinking a sprite every 2 seconds for example..I will try it out thanks!
  14. Hi, I am new to Phaser(and Javascript) and I am working on my first HTML5 game. In my game I have the following: If player touches floor-->game-over-->wait for x seconds(keep updating)->show menu. I am looking for a way to implement the "wait for x seconds"/ timer. I have worked with Unity before and within Unity you can use coroutines to yield the execution of your function for a certain time: https://docs.unity3d.com/ScriptReference/WaitForSeconds.html By using coroutines, there was no need to use a timer within the update function. Is there a similar approach to this in Phaser using Javascript (implementing timers without using the update function)?