Awesome-Game-Team / Awesome-Game

An Awesome Game
GNU General Public License v3.0
8 stars 9 forks source link

Load screen with orientation detection. #29

Open metalx1000 opened 8 years ago

metalx1000 commented 8 years ago

We need a load screen that detects if the player has their devices in Landscape orientation. If the device is not, it needs to ask the player to rotate their device before the game starts.

OneSleepyDev commented 8 years ago

In Cordova it can be forced. But.. There's an example in the Phaser projects [1]. And someone here [2] made an example using another method.

[1] https://github.com/photonstorm/phaser/tree/master/resources/Project%20Templates/Full%20Screen%20Mobile [2] http://www.emanueleferonato.com/2015/04/23/how-to-lock-orientation-in-your-html5-responsive-game-using-phaser/

metalx1000 commented 8 years ago

Thanks @OneSleepyDev. I've tried to incorporate that code into ours. I'm doing something wrong. I've been playing with it for two hours and everything I try, something else goes wrong and then I go in circles.

If anyone has time, please look over the "display.js" and try to figure out what I'm doing wrong. I think I just need some fresh eyes on this.

It's funny how the things that are suppose to be simple turn out to be the hardest.

jonpatterns commented 8 years ago

I don't think the scale modes for fullscreen and non fullscreen need to keep on being set. They should be configured when the game initialises and that's it. Potentially the resizeGame function is messing things up, because its trying to set individual settings that phaser can take care of.

there is also a game.time.desiredFps setting, it may make the game smoother on slower systems. Example: http://phaser.io/examples/v2/time/slow-down-time

Another thing to increase performance on firefox may be layer.renderSettings.enableScrollDelta = false

as explained here: http://www.thebotanistgame.com/blog/2015/03/04/tuning-phaserjs-performance.html

metalx1000 commented 8 years ago

@jonpatterns Great suggestions. I'm currently working on the enemies and other aspects of the game. It would be great if you could push some code on this topic. You seem to have some understanding on it, more than me for sure. So, before I spend another 2 hours getting no where because I'm going in circles, I'd love to see when you come up with. If you have the time.

Also, I can make you part of the time if you want. Then I can assign parts of the project to you.

jonpatterns commented 8 years ago

I'll see what I can do. I'll have more time after next Wednesday. I don't have a smart phone to test that side of things.

metalx1000 commented 8 years ago

@jonpatterns no hurry. But the problem is mainly due to trying to get things working well on phones. But, you can always try using the "Device Mode" in Chrome. It let's you emulate different devices.

Glissando commented 8 years ago

I implemented this in my own project, not on the loading screen though. Could implement it here if no one else is on it.

https://github.com/Glissando/Gentry-Public/blob/master/Gentry/js/Scene.js