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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.