Sign in to follow this  
syntaxidermy

Custom image class with colour property using Phaser 3 / Javascript

Recommended Posts

Hi,

 

I'm working on creating interactive buttons which, when clicked, will set the colour of the player.

 

I've managed to do this successfully, in Phaser 3, but the code is quite bulky and ugly looking. I've just been gathering what examples I can through the website, but I'm certain there must be a better way to do this.

Here's what I've got:

image.thumb.png.4b37d253b8c01df037f20b21b42c1aa9.png

 

I think what I want to do is create a class for "smalltiles", but I'm not sure how the inheritance should work for using alongside Phaser 3. 
 

I've tried writing something like in several different ways, without success:
image.png.e31d800005c36ca46dc6743d2c32ad4c.png

Does anybody have any insight as to how I  might be able to do this better?

Thanks for the input in advance. 

 

 

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...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.