Jump to content

Search the Community

Showing results for tags 'tweens'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
  • Frameworks
    • Phaser 3
    • Phaser 2
    • Pixi.js
    • Babylon.js
    • Panda 2
    • melonJS
  • General
    • General Talk
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Twitter


Skype


Location


Interests

Found 24 results

  1. Hi, I'm using the arcade physics engine. I'm trying to move a cloud left and right via tweens but the problem is the arcade box isn't moving with it. Does anyone know how to fix this? createTweens() { this.scene.tweens.add({ targets: this, x: this.distanceX, duration: this.speed, yoyo: true, loop: - 1 }); }
  2. I created a simple timeline to simulate a card unfold animation, there are 2 tweens inside it, one is changing the card's scaleX from 1 to 0.01 and another one just does oppositely. var timeline = this.scene.tweens.createTimeline(); timeline.add({targets:this.cardFace,scaleX:0.01,duration:500,ease:Phaser.Math.Easing.Cubic.Out,onComplete:function(){this.cardFace.setFrame('heart-2')}}); timeline.add({targets:this.cardFace,scaleX:1,duration:500,ease:Phaser.Math.Easing.Cubic.Out}); timeline.play(); my question is, how to ignore the tween's duration, and immediately jump to the end. in some
  3. hi everyone, I was asked by my fiance how hard it would be to program a memory game.. .. challenge accepted So I came up with this, using some test-sketches done by her as the cards: Play now It was fun to code (thanks to phaser!) and a good exercise in using tweens (had only used them briefly before). The game mostly consists of phaser buttons (as the cards) that are moved around using tweens. If you have any comments/questions please let me know.
  4. This is my async.forEachSeries function: async.forEachSeries(parsed.moves,function(move, callback) { that.moveObj(move, callback) }, function() { console.log('done running the entire code') }); Move object is starting the tween and calling the callback onComplete of the tween. moveObject(x, y, obj,callbackToAsync, offsetX = 0, offsetY = 0) { let coordinates = this.convert(obj.i + offsetX,obj.j + offsetY) let tween = this.game.add.tween(obj, this.game, this.game.tweens).to({ x: coordinates.x, y: coordinates.y }, 2
  5. Hey Folks, I have been playing around with phaser for some time making simple stuff. But for my new project I would like to try to make a Fighter game. I would like to make a character that is capable of attacking and has fairly good hit collision with other entities in game. Since this is more of a theory question. I will try to explain my approach. The character is group. Made with 3 parts. Body(sprite), arm(sprite), sword(sprite, for example 20x80, angle: -90). Now I would like to make the sword angle to go down from 90 to 0, aka simulating an attack. I get that I could just c
  6. When my game in the browser loses focus, everything pauses: animations pause, music stops playing. HOWEVER, when I go back to the browser, the animations continue from where they left off, but the music behaves differently -- the music resumes at a point as if it had been playing in the background and time had elapsed. So then, my animations and music are out of sync. What is the simplest way of making animations and music behave similarly?
  7. Ok so Ill start with a quick example: https://i.gyazo.com/8ff58e047c8938dcf508b63bc18147bb.mp4 I start the example with a stationary swing and then proceed to swing while spinning. The station swing is perfect and smooth with zero jittering. The swing while rotating creates a horrible jitter effect. Right now the character is as follows: Base empty sprite holding everything. This only moves x and y. Bodyholder sprite is holding the characters body and is child of the base LeftArmHolder sprite is holding the left arm and is a child of the base RightArmHolde
  8. So, recently I created my own tweening functionality to overcome some issues I was having with Phaser's ones and make it fit my needs a little better. While doing so I realized Phaser, and apparently many other engines out there, precalculate the tweened values and store them into an array that's later used to update the object's values instead of calculating the value update on every frame. The way I see it, if calculating all the values for a tween that will be played for one second takes, let's say, 1 ms, I would prefer to have those calculations done in 1/60 ms during the whole secon
  9. hi there, got two questions about phaser 1. is there any tool to test a game performance? 2. how can i use two different properties in a sigle tween? thanks in advance!
  10. hi, I'm moving 2 chain tween but when the second tween is executed the position of the sprite is not updated... moveCase.to({x: 328}, 750, Phaser.Easing.Linear.In); moveCase2.to({x: sprites.position.x - 50}, 500, Phaser.Easing.Linear.In, true, 780); moveCase.chain(moveCase2); moveCase.start(); I tried a lot of things ... there is something I don't understand. Any help is greatly appreciate. Thanks
  11. Hi, I'm new to Phaser and I have some questions when using tween and fill color on which I wasn't able to find any information if it is possible. Basically, I have a straight short line (let's say 20px) which travels from the right side of the screen to the left, but when it reaches the middle part of the screen it creates a circular loop forming the letter "O" and then continues moving till it reaches the left side of the screen. What I wanted to do is when the short line loops in the middle part, the track should be filled with color and forming the letter O itself. Is this po
  12. I have a group of 6 elements and want them to do a specific tween separately with a delay between each. However, everything I've tries just seems to start them all together at once. var bulge = game.add.tween(tiles.getAt(i).scale).to({ x: 1.2, y: 1.2 }, 1000, Phaser.Easing.Back.InOut,false, 0, 1, true); Any help is appreciated
  13. Hello everyone, I have this doubt (little introduction before): I think is really helpful to use a sprite property to "store" another sprite. For example, when I have several enemies and I want all of them to have a health bar I can do something like this: var enemies = game.add.group(); for(var i = 0; i < 5; i++){ var enemy = game.add.sprite(0, 0, "enemy", 0); var health = game.add.sprite(enemy.x, enemy.y, "bar", 0); enemy.health = health; enemies.add(enemy); } By doing this, I can easily locate the health bar in the game later. For example if I want to chan
  14. Is it possible to tween a bitmap text object? I took some code from the Examples website and tried it on a bitmap text, but nothing happened. I tried the same code on a sprite, and it worked.
  15. Hi guys, in my game I have an arrow, which should rotate all the time from 50deg to -50deg starting from 0 deg. It should do that with the given timing. My code looks like: // POINTER TWEEN GH.g_pointerTween = _this.game.add.tween(GH.g_pointer) .to({angle: -_this.pointer_rotation_angle}, 400, Phaser.Easing.Linear.None) .to({angle: 0}, 400, Phaser.Easing.Linear.None) .to({angle: _this.pointer_rotation_angle}, 400, Phaser.Easing.Linear.None) .to({angle: 0}, 400, Phaser.Easing.Linear.None) .loop().start();The question is if that is
  16. Hi all, I was looking at using tweens in a simple application, and something struck me as odd when using `game.add.tween.to`. By looking at examples like this, it looks like you can pass in the easing function without specifying any arguments for it. E.g., game.add.tween(purpleFish).to({ x: -200 }, 7500, Phaser.Easing.Quadratic.InOut, true, 0, 1000, false);Reading from the docs, methods like Phaser.Easing.Quadratic.InOut need arguments to be passed in or they'll return NaN. However, the code above works fine without any arguments getting passed in to Phaser.Easing.Quadratic.InOut. Is somethi
  17. I have a group of enemies in a project i'm working on, I want them to move independent from one another, I can do this, but the animations are playing up. There is easing even though I have set it so there shouldnt be, also whatever I do the tween wont yoyo, repeat etc. Chaining is also not working, here is an example of what i'm doing: var enemyOne = this.enemies.children[0]; game.add.tween(enemyOne).to({x: 220}, 50, Phaser.Easing.Linear.None, true, 0, 0, true); What am I doing wrong, shouldnt this line make the enemy return back to its original position? Thanks
  18. I've been trying to extend the functionality of TweenManager, so it can resume and pause everything within a group. I adapted the code from here: http://jsfiddle.net/lewster32/L3u3gp5k/ http://docs.phaser.io/TweenManager.js.html#sunlight-1-line-127 When debugging with console, _tweens and _add are undefined for each object, so the function doesn't work. I think the code is correct? Any ideas why this isn't working? I'm guessing i've missed something crucial about _tweens. Here's the code: (This goes out to Rich and Lewster) Phaser.TweenManager.prototype.pauseAllFrom = function(obj,
  19. Hello everyone, I'm actually working on a Phaser Game. I'm already done a pathfinding for getting the path my soldier should take. Now I would like to make tweens for it and create a chained tween with each tile of the path. Every infos I found don't speak about creating a tween object. Like it we could add new steps to it and after assign it to a sprite for example and play it. Sorry for my english... (FrenchStyle ^^) github : GreG28
  20. Hi all and thanks for reading. Me and my team are working with Phaser ,creating Games 9 months now. Recently we have encountered a problem when running our games on slower machines. It seems like that when we are trying for example to run a tween(moving an object from a spot to another) , the slow PC is unable to demostrate the actual tween and the object just jumps to the final position. From what we understand when we say to the tween to complete in 600ms, the slow machine in not reacting accordincly. Maybe it takes like 600ms for the slow PC to proccess the script and thus the actual script
  21. Hi, I'm making a simple game with Phaser I have a spritesheet with two frames. I need an animation of sprite disappear, frame change and appear again like .to( {x:0, y:0 }, 600, Phaser.Easing.Bounce.Out); .frame = 1; .to( {x:1, y:1 }, 600, Phaser.Easing.Bounce.Out); How do i connect it into one chain? Thanks,
  22. I've set up a chain of tweens by chaining the 'to' method. e.g. this.tween.to({angle: 180}, 2000, Phaser.Easing.Linear.None). to({x: 300}, 3000, Phaser.Easing.Linear.None);but I need to be able to stop the tweens. If I call stop on the parent (this.tween) that stops it in its tracks but the other one then starts. How do I stop the entire chain. I could write some manager to keep track of them but I'm sure that's not the way to do it. I saw the TweenManager has a removeAll but that looks like it would take out other chains as well.
  23. Hi. I have a sprite with chained tweens. The first twenn move the x position of the sprite. And the second tween change the scale to -1.2. I do this because the sprite must turn. My problem is that the size doesn't follow correctly the sprite. This is my code. this.mummy = this.game.add.sprite(580, 406, 'mummy'); this.mummy.scale.setTo(-1.2, 1.2); this.mummy.body.gravity.y = 8; this.mummy.animations.add('walk'); this.mummy.animations.play('walk', 12, true); this.game.add.tween(this.mummy) .to({
  24. Hi, I'm just starting out with Phaser, really like it so far and have managed to figure most things out from the examples and this forum. I was wondering if there was any way to add a tween to a group? I am guessing you might use the forAll function, but I'm not sure how this works. This is what I would like to do: game.add.tween(titleScreen).to({alpha: 0},2000,Phaser.Easing.Linear.None,true);Where titleScreen is a group of sprites that comprise my title screen. Thanks, Anton
×
×
  • Create New...