# Rudrabhoj Bhati

Members

283

• #### Days Won

2

Rudrabhoj Bhati had the most liked content!

## 1 Follower

• Rank
• Birthday 12/22/1994

## Contact Methods

• Website URL
http://ojomazda.com
• Skype
sanatan_tech

• Gender
Male
• Location
Cyberspace

## Recent Profile Visitors

2846 profile views

1. ## Phaser 3 show_all responsive example?

1. Find the golden ratio (ideal height / window.innerHeight) (Or width, see 2nd point) 2. Resize the game in a way you either use entire height. To do that, divide your ideal height by golden ratio, then divide your ideal width with the golden ratio. (or do the opposite, if it doesn't fit like that. You can know this if width you get is larger than window.innerWidth) 3. Now, use your golden ratio to reinterpret where you would place your objects. x = 20 in a 1280x720 game becomes 10 in a 640x360 game. You get the golden ratio of 2 (720/360). 20 /2 = 10. 4. You have to use the golden ratio to reinterpret the scale too. In the above example, you would divide whatever scale you have by 2. Tips: 1. Abstract away the phaser sprite as a component of your new Sprite type. 2. Use getters and setters when you send and receive values for the x and y properties of the sprite component. When you get them, divide it by the golden ratio and then change it in the sprite component. When you are asked for them, multiply from the value in the sprite component and send. Do save the original values privately. 3. Do the same for the scale. 4. Every resize updates everything. 5. Ensure that you don't deal with actual values directly, you have to always deal with assuming x = 20 (not 10), actual values should only work internally. 6. See the example of how to handle different values internally, and sending different values through getters. get x() { let gRatio = this._getGoldenRatio(); return this._sprite.x * gRatio; } get y() { let gRatio = this._getGoldenRatio(); return this._sprite.y * gRatio; } set x(xVal) { let gRatio = this._getGoldenRatio(); this._sprite.x = xVal / gRatio; } set y(yVal) { let gRatio = this._getGoldenRatio(); this._sprite.y = yVal / gRatio; } EDIT: Make sure to store golden ratios internally too, and when the global ratio changes (because of a resize) update everything. By x and y getters you would get ideal values, divide it by new golden ratio. Update values on the sprite component and then update the stored golden ratio.
2. ## Does PixiJSv4 Have "Pixel Perfect Collisions"?

Why would you need pixel perfect collision on something like a space shooter?
3. ## Phaser and larger-scale games?

Phaser is okay for large games. Problem lies in the architecture of the games. You have to properly manage the resources. Plan downloads and rendering properly. Draw what is required, download what is required, in a planned manner. A poorly constructed game would be overkill on any platform. Phaser and JS just require us to be extra careful with the performance. Understand what performs well and what doesn't.
4. ## Advise - Phaser/OpenFL/Something Else

1. If you just want to convert the old stuff, and do not want to develop new HTML5 'elearning material', then by all means use OpenFL. 2. If you want to not only convert the old stuff, but also want to develop new HTML elearning material in future, use Phaser.
5. ## What skills are required for Phaser development?

Give a try to Haxe/OpenFL, if you want a language something similar to JavaScript, but ability to export native iOS and Android games. OpenFL also support HTML5 export. If you find OpenFL too low level, try HaxeFlixel.
6. ## Only few days left to submit your game!

Just a little suggestion, registration shouldn't show countries outside south east asia, if developers only from those countries are allowed.
7. ## What is the best stack to use?

I personally use ES6 with Grunt for both Phaser and PIXI.
8. ## From 0\$ to 100\$/day from games journey: First Launch - Nature Basketball.

Just a little constructive criticism: The graphics of the game doesn't match with each other, graphical theme isn't consistent. Best of luck
9. ## ES6 Class Usage Example

Why would you want to load images there? You need a separate Load state. That will solve the problem.
10. ## How can I lock FPS?

I think this might be helpful
11. ## Re-program Flash games into HTML5

I have emailed, did you get my email (agnis.tech[at]gmail.com)?
12. ## Need a HTML5 game dev to make s\a Simple HTML5 for an expo

Hello, Very interesting project. I can do this in 1 week or less. This is my lastgame, Icy Babel: CLICK TO PLAY You can contact me here on the threat, personal message at forum, or at skype and/or email. My skype is: sanatan_tech My email is: agnis.tech@gmail.com Regards, Rudra
13. ## What's wrong with websites designs? Nobody cares for 1024x768 resolution anymore?

My next game is being created at 1280x740 too hehe. I haven't tested phaser's scaling down a lot, hope it'll work.
14. ## [Tutorial] Cooking a New Game in Phaser

In this article I show a design pattern of writing a HTML5 game in phaser, specially helpful for writing larger games. Phaser is one of the best HTML5 game development frameworks in the wild west of Javascript world. It is certainly a powerful tool when used carefully. Phaser imposes no design decisions over you, it gives you complete freedom over what design patterns you want to choose. I have been using Phaser for more than a year. With time, I created a ‘design pattern’ which would be helpful in making games. I also created some tools to help me in C++ and FreeBASIC like the one which converts Overlap2D output to usable Phaser state in both Haxe and JS. Continue Reading Here