
Phempt
Members-
Content Count
197 -
Joined
-
Last visited
-
Days Won
2
Phempt last won the day on November 18 2014
Phempt had the most liked content!
About Phempt
-
Rank
Advanced Member
Recent Profile Visitors
1401 profile views
-
-
-
Oh my god, I really hate android, this code will works: HEAD: var ua = navigator.userAgent.toLowerCase(); isAndroid = ua.indexOf("android") > -1; $(document).ready(function(){ //alert(window.orientation); if(window.orientation == -90){ orientationValue = 1; }else if(window.orientation == 90){ orientationValue = 0; } $(window).on("orientationchange",function(){ if(window.orientation == -90){ orientationValue = 1; }else if(window.orientation == 90){ orientationValue = 0; } });});player.js: if (game.accelerometer) { if (game.accelerometer.y < -0.2 || game.accelerometer.y > 0.2){ if(orientationValue === 1){ if(isAndroid) { player.velocity.x -= game.accelerometer.y * game.system.delta * 100; }else{ player.velocity.x += game.accelerometer.y * game.system.delta * 100; } }else if(orientationValue === 0){ if(isAndroid) { player.velocity.x += game.accelerometer.y * game.system.delta * 100; }else{ player.velocity.x -= game.accelerometer.y * game.system.delta * 100; } } }else { player.velocity.x = 0; } }
- 6 replies
-
- accelerometer
- gyroscope
-
(and 1 more)
Tagged with:
-
damn that code slowdown performance on Android (works perfectly on iOS)
- 6 replies
-
- accelerometer
- gyroscope
-
(and 1 more)
Tagged with:
-
at the moment I used jQuery: $(document).ready(function(){ $(window).on("orientationchange",function(){ if(window.orientation == -90){ orientationValue = 1; }else if(window.orientation == 90){ orientationValue = 0; } });});but if there's a pandaJS function I'll change my code.
- 6 replies
-
- accelerometer
- gyroscope
-
(and 1 more)
Tagged with:
-
is there a way to detect if landscape mode is with home button to the right or left? Because the accelerometer effect on sprite, it change based on this difference.
- 6 replies
-
- accelerometer
- gyroscope
-
(and 1 more)
Tagged with:
-
probably it depends on PandaJS version. have a great day
-
Hello mirage29, first of all: Welcome in order to debug your game add ?debugdraw to the end of the url. Example: http://yourhost.com/yourgame/index.html?debugdraw Than, is it possible to see the source? Can you upload it somewhere?
-
I used this: floorSprite = new game.Sprite('env/black.png'); floorSprite.width = floorShape.width; floorSprite.height = floorShape.height; floorSprite.position.x = floorBody.position.x; floorSprite.position.y = floorBody.position.y; floorSprite.anchor.set(0.5,0.5); floorSprite.addTo(game.scene.bgContainer); game.scene.addObject(floorSprite);is there a better way? because this method stretch a sprite to fill a shape, but it's not a repeatable texture.
-
Hello guys, is it possible to color a body shape with a repeatable texture? Something like: var floorBody = new game.Body({ position: { x: game.system.width / 2, y: game.system.height - 35 }, collisionGroup: 1 }); /* GAME STANDARD SHAPES & BODIES */ var floorShape = new game.Rectangle(game.system.width, 70); floorShape.TEXTURE = new game.sprite('env/black.jpg'); //something like this floorBody.addShape(floorShape); this.world.addBody(floorBody);
-
-
-
Can I offer you a beer? Do you have a paypal account?!
- 6 replies
-
- accelerometer
- gyroscope
-
(and 1 more)
Tagged with:
-
Hello guys, I want to move my sprite to left/right using the gyroscope/accelerometer. Is there something on panda to do this? Edit: Unfortunately the link here: http://www.html5gamedevs.com/topic/7064-how-to-use-accelerometer/?hl=accelerometer is offline.
- 6 replies
-
- accelerometer
- gyroscope
-
(and 1 more)
Tagged with:
-
Good job
- 34 replies
-
- game
- simulation
-
(and 1 more)
Tagged with:
-
Good luck with your game