Jump to content

Custom image class with colour property using Phaser 3 / Javascript


syntaxidermy
 Share

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. 

 

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...