Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Behaviours #1

Merged
merged 8 commits into from
Jul 1, 2021
Merged

Behaviours #1

merged 8 commits into from
Jul 1, 2021

Conversation

SerZak05
Copy link
Owner

@SerZak05 SerZak05 commented Jul 1, 2021

Major features have been restored, now added flexability.

Major changes, some features are not working for now.
Now field, objects and buttons make a hierarchy tree, that changes when the mode changes.
Removed old entities inheritance tree, now there is one Entity class. All objects are composed of different behaviours. All the compositions of objects (their stats, behaviours) are described in assets/units.json file. That means that to change some stats and re-balance units or add a new one we don't need to change the code. Behaviours can be automatically constructed from json, so adding new behaviours to objects will be easy.
Added Movable behaviour, builder coming soon.
Info and menu panels now are composed of info and menu panels of behaviours using pack method.
Some minor changes: targetHex is now field method, removed more of global stuff (buttons, entities list -> field).
Squad mechanic is not working. Deprecated entity builders because entities are constructed from json file.
Added mouse related methods to Button, added label and list of behaviours to menu panel.
Created a label inside a button for customization.
Now in units configs you can specify the image name and transparency mask name for that image.
Masks can be created using create_mask python script.
Added Drawer class for drawing all widgets based on their z coordinate and not based on their hierarchy. It sorts all of the widgets by z coordinate, so we can have UI that is displayed in front of the field, no matter when it has been added. Prior to adding new Widgets it is possible to set default z coordinate, so it wouldn't be annoying to set it in all of the widgets manually.
Reworked changing scenes -> separate changeScene() function to change and setup scenes.
Changed transformation of matrices in widget hierarchy (and added scale), now all transformations are in transformMatrix() method, so we can change it easily. It is used in draw() instead of translate().
Formalized adding entities onto the field, so they can draw properly and initialize. Changed Entity.init() method, now it is called only from field.addEntity().
Deprecated CustomButton because it is unused.
Fixed food counter position, parent of labels in entity constructors.
@SerZak05 SerZak05 merged commit 12407df into master Jul 1, 2021
@SerZak05 SerZak05 deleted the behaviours branch July 2, 2021 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant