Fighting and gathering
Secret of the Basilisk (prototype) » Devlog
After playing with movement of entities the whole weekend (kids were gone), I ended up with an Action class that each entities will have.
var ACTION_TYPE_NONE = -1; var ACTION_TYPE_IDLE = 0; var ACTION_TYPE_MOVE = 1; var ACTION_TYPE_ATTACK = 2; var ACTION_TYPE_GATHER = 3; var ACTION_TYPE_TALK = 4; function ActionInformation() { this.animation = null; // Current running animation this.currentActionType = ACTION_TYPE_IDLE; this.isExecuting = false; // Are we doing the end going or going to the end goal this.isReady = false; // Temporary variable used in planning // Most actions are done on a tile beside the entity this.startLocation = null; // { x: 0, y: 0 }; this.angle = -1; // Which angle to walk, attack, gather, talk, ... // The end goal of the action // It could be going to an entity or going to a specific location this.longTermActionEntity = null; this.longTermActionLocation = null; // { x: 0, y: 0 }; // When the action is taking place this.goalExecutionTurns = 0; // When the action end goal is starting, count the number of times it's been running // Action for next turn // When an event need to interupt the current action, need to keep this information // until the next turn starts this.nextTurnActionType = ACTION_TYPE_NONE; this.nextTurnActionEntity = null; this.nextTurnActionLocation = null; // { x: 0, y: 0 }; }
Anyone know how to add empty new line in the code here?
It works well, but when fighting enemies, I coded a "walking through enemies" logic by mistake :)
I used some sort of A* path finding and it works well. This time, the engine allow having walls on the edge of tiles. This gives me the opportunity to have things in the corner of walls.
Secret of the Basilisk (prototype)
IDLE, incremental game with a bit of a story.
Status | On hold |
Author | Fluffy Lotus |
Genre | Adventure |
Tags | 2D, Idle, Unity |
Languages | English |
Accessibility | One button |
More posts
- How I'll start developing my new gameJan 04, 2020
- Building up the storyNov 25, 2018
- New quest UINov 08, 2018
- UI TweakingNov 07, 2018
- First version of the new gameOct 27, 2018
- Player stats; 1.3 or 13?Oct 18, 2018
- Battle SimulatorOct 15, 2018
- Starting to implement the story!Oct 09, 2018
- Figuring out what to do with experienceOct 07, 2018
- Working on the UISep 28, 2018
Leave a comment
Log in with itch.io to leave a comment.