AlmasB / FXGLGames

This repo contains sample games built with FXGL
http://almasb.github.io/FXGLGames/
MIT License
800 stars 326 forks source link

Tower Defense towerbase #34

Open prince1107 opened 1 year ago

prince1107 commented 1 year ago

Hi Almas,

How are you initializing the towerbases in tower defense?

Screenshot 2023-04-23 at 19 00 27

I was making my own version of zombs.io and was wondering how to set the onClick for an object made in the tmx?

prince1107 commented 1 year ago

@AlmasB

AlmasB commented 1 year ago

The .tmx objects are parsed via the EntityFactory's related method, i.e. the one marked with the correct type / class in @Spawns(). There you can use onClick as above.