Search the Community

Showing results for tags 'rotation'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Coding and Game Design
  • Frameworks
    • Phaser 3
    • Phaser 2
    • Pixi.js
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • 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 164 results

  1. Hello ! I'm trying to set a mesh at the center of my canvas while using a free camera, but I have difficulties. Considering that it's a mandatory feature in fps games, I thought that I may have a response using babylon js transformations classes, and camera worldMatrix and viewMatrix. Thank you in advance !
  2. Hello. I'm trying to follow http://gamemechanicexplorer.com/#homingmissiles-1 but my missiles end up pointing in the wrong direction all the time. So I simplified and removed basically everything but the rotation of the bullet. But even with a centered stationary bullet it ends up facing in another direction than where the pointer is. Missile.prototype.update = function() { var targetAngle = this.game.math.angleBetween( this.x, this.y, this.game.input.activePointer.x, this.game.input.activePointer.y ); this.rotation = targetAngle;}; I'm using 2.0.3 Any thoughts on what might be wrong here?
  3. Hey all, Just a quick heads up to share an odd solution to a problem that had me tearing my head out for a couple of days, thought it may come in handy for anyone else in the same boat. While working on a game where I was using P2 physics to detect a collision event between 2 physics bodies, I found that whenever the target sprite was rotated further than a certain amount all of my collision events would silently fail. I spent AGES trying different collision methods and none of them worked, when trying to implement a hack-ish workaround that I found on the forums (can't remember where) I realised that my collisions were now working fine, even though the method I was using returned something to the effect of "this doesn't work". Long story short - I found that by resetting a physics body's AABB data after every change in rotation made the collision events work again: //attackingThing.body.onBeginContact.add(reportSomething, this);//function rotateThing() { // thing.rotation += 1; // reportSomething fails unless you do this thing.body.data.updateAABB();}If anyone can enlighten me as to what/why/how this works, that'd be awesome. Phase on, dudes! OFM
  4. Hi there!! How to rotate Physics.Arcade.body? I've tried set the Physics.Arcade.Body.rotation(after set the allowRotation to true) to be equal to te sprite angle, but, nothing happends...
  5. I want to make a game, when you click on target, the DIV append an image in it, When i click on the face, you can see that the DIV append a bullet image, which is good. but when you click on the right arm, the position of the bullet is wrong. it's because the arm is transform: rotate(25deg); with CSS3. this is my screenshot http://i.imgur.com/oZ5VnD6.png How can i determine the right position of the bullets when i click on the arm ? thank you
  6. Hi there, I was just wondering if it's possible to lock the rotation of a body in p2, so it would behave like it would in arcade physics. Or is it possible to mix and match physics bodies between engines? Sorry, kinda new at this. Thank you in advance!
  7. Hi! I have problems changing the rotation and position of meshes when i have added physics to them. I have taken a look at the tutorial (https://github.com/BabylonJS/Babylon.js/wiki/How-to-handle-rotations-and-translations) but still haven't found a solution. I have manage to change the rotation and position before i have added physics to the mesh but i would rather change the rotation and position without removing and adding the mesh every time i want to change it's position and rotation. I think the problem is that i don't manage to get these two function to work. mesh.rotate(BABYLON.Axis.X, 1.0, BABYLON.Space.LOCAL);mesh.translate(BABYLON.Axis.X, 1.0, BABYLON.Space.WORLD); Saying that property.X is undefined. Any suggestions and comments are more then welcome!
  8. Hi, I'm tring to port an old game to 2.0 and I can't find the body.allowrotation for Arcade Physicsm do I need to change the physics engine to rotate my sprite body ?
  9. So I'm currently trying to make a sprite that just moves around in a circle forever. I was using the example found here: http://examples.phaser.io/_site/view_full.html?d=physics&f=angular+velocity.js&t=angular%20velocity as a base. My code for creating said sprites looks like this: @map.createFromObjects 'PlatformLayer', 45, 'platforms', 0, true, false, @circPlatforms @circPlatforms.setAll 'body.allowGravity', false @circPlatforms.setAll 'body.immovable', true @circPlatforms.forEach ((platform) => platform.radius = (+platform.radius or 1) platform.rotAngle = +platform.rotAngle or 0 @game.time.events.loop 1, ((platform) => platform.body.velocity.x = 0 platform.body.velocity.y = 0 @game.physics.velocityFromAngle platform.rotAngle, platform.radius*32, platform.body.velocity platform.rotAngle = ++platform.rotAngle % 360 ), @, platform ), @In Tiled I assign a rotAngle (the current spot in the rotation) and a radius (the number of tiles I'd like it to cover). Unfortunately, I have no idea what I'm doing. I can't seem to get the sprite to move faster along the circle (increasing the speed parameter just seems to make the circle larger and body.angularRotation, body.angularAcceleration, and body.speed don't seem to help either), and I'm not at all certain how to ensure the radius in tiles (a tile for me is 32x32). Also, when this sprite gets to the end of a full rotation, it is not where it started, it's somewhere off to the top-left. I can't figure out how to determine why it's doing that. Overall, I'm just sorta confused about this whole ordeal. Any ideas?
  10. I've making my first game so far is great but I have a display problem. when I rotate the sprite it become's blurry, same happens on jumping and falling the sprite turns blurry. Can anyone help me fix it. I'm using Chrome with WebGl and WebAudio. is there anyway I can make the sprite to not become blurry...Thanks By the way Wonderful framework I started the styding and making the game last night and I'm closer to finished thank you. And from the google searching I see that the administrators (are those the creators?) are responding quickly... Just great keep up
  11. Using an ArcRotateCamera you can set the rotation on creation of the camera, is there a way to do something like, camera.rotation.x and camera.rotation.y to change the rotation of a camera already in the world? I'm assuming that it would be better to not just make a gazillion cameras every time that I want to manually change the rotation though as far as I can see the only way to set a camera is on creation! When I try my method above it just says "Cannot set property 'x' of undefined".
  12. Hello, I was studying from code in 'Tanks' example game that came with Phaser package in github. I was looking for line of code that set speed of enemy's bullet and how it shoot to player. I found this very line: bullet.rotation = this.game.physics.moveToObject(bullet, this.player, 500);It comes out that this line makes the bullet shoot to player. In my sense, bullet.rotation should only change the angle of the bullet, but didn't apply any velocity for it to move. Could you explain how does this work? p.s. Sorry for dumb question here. I am just trying to understand the code.
  13. rea

    Group rotation

    Hi, I started to create a simple game - tetris. Unfortunately I have 2 problems: - how to move group rotation point from top left corner to the center? - is there a possibility to check collision when moving group by change x property (I override tween, but it still moves down)?
  14. Hey folks! I'm trying to make a game of Asteroids, and I want to steer my ship! So I added the following code to change the angle: if(game.input.keyboard.isDown(Phaser.Keyboard.D)) player.angle++;It works at first, but then it gets stuck and the angle won't change. Generally this happens after 360* or so. I'm guessing that this has something to do with the number getting too large (which mathematically shouldn't make a difference, right?). I created a workaround: var rotation = 0;function update() { if(game.input.keyboard.isDown(Phaser.Keyboard.D)) player.angle = rotation++ % 360;}But creating my own rotation variable seems to defeat the purpose of having an angle variable in the first place. Am I doing something wrong? Is there a better way to make use of angle? I've been looking through the source, but I haven't had much luck yet (JavaScript is not my first language). Thanks & Regards.