InvadingOctopus / comedot

Component-based framework and project template for 2D Godot games
https://godotengine.org/asset-library/asset/3163
MIT License
54 stars 4 forks source link

Improve example & suggestions #1

Open danbraik opened 1 month ago

danbraik commented 1 month ago

Hello, thank you for this framework, I think it has a lot of potential. I have played around and I have some suggestions to improve:

Again, great work, I like the utility functions in Entity script and the quantity of available components!

ShinryakuTako commented 1 month ago

woo 1st issue!

it cannot be installed as an addon … the scripts were refering to "res://Entities" for exemple which is a folder outside the addon … Maybe this is an explicit intention to start with the full project ?

[Fixed] Yes, it's not a standalone add-on! I submitted it to the Godot Asset Library as a "Project Template". The first time you open the project, there will be many errors because the images etc. need to be imported first. Just close the project after Godot finishes scanning the files, and then reopen it.

It seems that the tileset image source isn't in the repo

[Fixed] There is! Again just close the project and reopen it so the resources can get imported correctly.

CollisionShapes for combat are already embedded … so it is not configurable

[Fixed] Right-Click on each Component node that you want to configure and enable "Editable Children" :) That will let you edit the shapes etc. for things like the DamageComponent.

The order of "ease of use" → "more power and control" goes like this:

  1. Use one of the templates from res://Templates/
  2. Use the premade components and tweak their parameters in the Editor Inspector.
  3. Enable Editable Children or Make Local to modify the subnodes of a component.
  4. Make a subclass of a component's script, like extends DamageComponent and add your own features on top of the existing functionality.
  5. Modify the original scripts to completely modify or replace the default functionality.

A suggestion about having an animation at death.

[ToDo] I will add animation components later. Right now you can "glue" everything together by making "master" components like "MyPlayerComponent" or "MyMonsterComponent" which connect to the signals of other components, like HealthComponent.healthDidZero, and control an AnimationPlayer node based on the state of other components.

danbraik commented 1 month ago

Hi, thank you for the answer! I like your order of usage, it make sense to enable "Editable Children". I think it may allow too to make update to the original component and having the update everywhere.