This repository has been archived by the owner on Feb 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
LNX-69 Add bear #14
Open
alpinus4
wants to merge
10
commits into
master
Choose a base branch
from
LNX-69-add-bear
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
LNX-69 Add bear #14
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alpinus4
changed the title
[WiP] Add bear, start working on a state machine
[WiP] Add bear
Jan 19, 2023
alpinus4
requested review from
filip-szweda,
blazej-smorawski,
Krystian030 and
EasyJB
January 20, 2023 15:04
I changed external state machine to written by me. Also bear behavior was implemented. { "base_class_name" : "Action", "class_name" : "NextScene", "properties" : {} }
{ "base_class_name" : "Object", "class_name" : "Floor", "properties" : {"id": 0, "position": "(0,0)"} }
{ "base_class_name" : "Object", "class_name" : "Floor", "properties" : {"id": 1, "position": "(0,1)"} }
{ "base_class_name" : "Object", "class_name" : "Floor", "properties" : {"id": 2, "position": "(1,0)"} }
{ "base_class_name" : "Object", "class_name" : "Floor", "properties" : {"id": 3, "position": "(1,1)"} }
{ "base_class_name" : "Object", "class_name" : "Floor", "properties" : {"id": 4, "position": "(0,2)"} }
{ "base_class_name" : "Object", "class_name" : "Floor", "properties" : {"id": 5, "position": "(1,2)"} }
{ "base_class_name" : "Object", "class_name" : "Bear", "properties" : {"id": 6, "position": "(1,0)"} }
{ "base_class_name" : "Object", "class_name" : "Agent", "properties" : {"id": 7, "position": "(0,0)"} }
{ "base_class_name" : "Action", "class_name" : "Idle", "properties" : {"object_id": 6} }
{ "base_class_name" : "Action", "class_name" : "Move", "properties" : {"object_id": 7, "direction": "NORTH"} }
{ "base_class_name" : "Action", "class_name" : "PrepareToSlam", "properties" : {"object_id": 6} }
{ "base_class_name" : "Action", "class_name" : "Move", "properties" : {"object_id": 7, "direction": "NORTH"} }
{ "base_class_name" : "Action", "class_name" : "Slam", "properties" : {"object_id": 6, "points": ["(1,1)", "(0,0)", "(1,-1)", "(2,0)"]} }
{ "base_class_name" : "Action", "class_name" : "Idle", "properties" : {"object_id": 6} }
{ "base_class_name" : "Action", "class_name" : "Move", "properties" : {"object_id": 6, "direction": "NORTH"} }
{ "base_class_name" : "Action", "class_name" : "Move", "properties" : {"object_id": 6, "direction": "NORTH"} }
{ "base_class_name" : "Action", "class_name" : "PrepareToSlam", "properties" : {"object_id": 6} }
{ "base_class_name" : "Action", "class_name" : "Slam", "properties" : {"object_id": 6, "points": ["(1,3)", "(0,2)", "(1,1)", "(2,2)"]} }
{ "base_class_name" : "Action", "class_name" : "DealDmg", "properties" : {"object_id": 7, "dmg": 10} }
{ "base_class_name" : "Action", "class_name" : "Idle", "properties" : {"object_id": 6} }
{ "base_class_name" : "Action", "class_name" : "PrepareToSlam", "properties" : {"object_id": 6} }
{ "base_class_name" : "Action", "class_name" : "Slam", "properties" : {"object_id": 6, "points": ["(1,3)", "(0,2)", "(1,1)", "(2,2)"]} }
{ "base_class_name" : "Action", "class_name" : "DealDmg", "properties" : {"object_id": 7, "dmg": 10} }
{ "base_class_name" : "Action", "class_name" : "Idle", "properties" : {"object_id": 6} }
{ "base_class_name" : "Action", "class_name" : "PrepareToSlam", "properties" : {"object_id": 6} }
{ "base_class_name" : "Action", "class_name" : "Slam", "properties" : {"object_id": 6, "points": ["(1,3)", "(0,2)", "(1,1)", "(2,2)"]} } |
Added some improvements to the multi-field stuff. Seems to be working properly on the front-end. |
super().__init__() | ||
self.properties.object_id = object.properties.id | ||
self.object = object | ||
self.properties.points = points |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This thing is a little tricky. Right now front-end does not support deserialization of lists but I think it should not be a problem to add something like that. I guess it will be enough to have some helper function in Deserializer
to call strtok
.
Bear was killing itself, not an issue anymore |
StateMachine from transitions is overly complicated, and hard to integrate into the code. Add simple state machine to solve this problem. Remove external dependency.
Now state machine iterates over transitions for current state, and picks first matching
alpinus4
force-pushed
the
LNX-69-add-bear
branch
from
February 9, 2023 16:20
44c09d9
to
6405499
Compare
Rebased onto master |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added new enemy bear, as well as new actions prepare_to_slam and slam.
For now bear does 3 to 4 actions in one tick
idk if it is possible to make machine dependent on ticks, so that one state is executed per tick, to be done later