Darkiel

Approach for a tennis game?

Recommended Posts

Hello there, I'm new around here and also newbie using Phaser. I have only coded turn-based games and I recently learnt how to make classic 2D platform games with Phaser (which is incredibly easier than I thought).

I'm interested on develop a tennis game. Watching some old NES tennis game, every tennis game use a vertical camera with some perspective which makes appear the closer half of the court bigger than the other one, does anyone knows how to approach that kind of camera/perspective?

Thank you!

Share this post


Link to post
Share on other sites

This is actually pretty easy to do. You can either create all your assets with that perspective in mind.. Or, you could skew your entire container. 

So as a state extends a group (formally a container), then you have access to a method called updateTransform. You can override this and warp the entire container, than thus every child of it. There have been a few discussions on this before, though I haven't seen any working code yet. 

 

Share this post


Link to post
Share on other sites

I remember someone once posted a great old-school racing game that mucked with transforms on containers, although in that case it was with DOM and a transform on the main container, which then also transformed all child elements using the same projection change, I'd imagine this is very similar conceptually to megmuts solution but with DOM rather than canvas elements.

Share this post


Link to post
Share on other sites
2 hours ago, mattstyles said:

I remember someone once posted a great old-school racing game that mucked with transforms on containers, although in that case it was with DOM and a transform on the main container, which then also transformed all child elements using the same projection change

http://codeincomplete.com/posts/javascript-racer/ ?
http://www.extentofthejam.com/pseudo/

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Recently Browsing   0 members

    No registered users viewing this page.