rh5140 / srs-team-bug Goto Github PK
View Code? Open in Web Editor NEW(WIP) Game developed Winter-Spring 2022 as part of ACM Game Studio's Students Run Studios program
(WIP) Game developed Winter-Spring 2022 as part of ACM Game Studio's Students Run Studios program
We need to have bugs be able to cause certain actions to not happen, and those rules need to be able to be disabled.
To make coding rules easier, also have a RuleBuilder with helper functions.
To allow progression even if level is really unbeatable for some reason
GetComponentsInChildren
and FindObjectOfType
are both slow and decentralized. Since there is only one board, we can centralize them there with only one call to them.
Transition to level at the end of the game.
This should require creating a new state EndLevel
with a corresponding event that gets called in SetWinCondition
(preferably with a helper function EndLevel
for encapsulation). This function should not cause the transition in case that there are animations. Instead, there should be another function that may act as a callback TransitionToMap
, that EndLevel
should call immediately for now.
Copy of issue #6
Reload scene to restart
we need to store information in the board about its size and either implement an IActionRule (created by the board) that prevents movement if the coordinate is outside or have that logic be in the MovementAction
There needs to be a singleton game state GameObject (DontDestroyOnLoad) that houses the data for what levels are completed.
There should also be a Game State implementation (separate class) that is serializable
Save/load from persistentDataPath
The state should not be loaded in the menu (think of the save file select menu, we don't want to preload each save file).
To fix this, we should either have a scene representing the loaded game or have the game state load/unload when specific scenes are loaded.
The first option would require turning current scenes into prefabs.
The second would require an inner state inside the persistent state that holds information about a save file
Can just have persistent loading through menus for the time being.
Need to store the last position on the map if the map is to be controlled by arrow keys
Need to have winning the game modify state by updating a list of levels won.
Also, this task will include going back to the menu on win.
Storing the inventory data in this state so that it is accessible from all
From Richard: The most straightforward way would be to have an Image
in the dialogue box and change Image.sprite
based on the person speaking (you'll have to write some function to handle converting the name to the appropriate sprite).
the map would be: new MovementAction(..., -action.direction)
, filter to only work on player
In BoardObject.cs
, event listeners are added, but they are not disconnected OnDestroy
, which will cause the object to not be destroyed until the event is destroyed (which can be a leak). Another problem is that the listeners are added OnStart
, which can cause multiple listeners to be added if the object is not destructed.
The player will determine if they are overlapping a bug, and, if so, increment the number of bugs caught in the Board and call the Bug's onCaught
function and detecting overlap
Dialogue levels not yet in game zzzz so don't worry yet
Check if the scripts are attached to anything, may need to reattach after organizing into folders
Goal: transition between "glitchy" and "normal" music based on number of bugs caught. Can use random placeholder music to work on this, actual music can get implemented later.
Persistent state between scenes
For now, this will just be the inventory!
Refer to this article for how to use save states. We will be using JsonUtility for now. Note that since MonoBehaviors cannot be serialized, there will need to be a separate state class and manager class.
Also refer to this article for where to store persistent data.
New state in the board that represents nothing happening
Either pauses or does not pause current animations (including the mid-turn animation)
Probably should pause mid turn, which would require modifying the board's execute code, as a coroutine is used to signal PostExecuteEvent and StartTurnEvent (both of which should not occur while paused). There is also update code in BoardObject that needs to be modified, and, of course, input code in player. Because a coroutine is used, you cannot set timescale to zero
UI for pausing with, for example, go back to map button and resume button.
Make an abstract bug class
Private boolean to keep track of whether caught, public function that player calls when player catches the bug, virtual function for behavior on the end of the turn.
Collision between player (for now) and surroundings probably via a rule in the board using coordinates of player and collidable (ie. check if coordinate the player moves to is collidable).
Also: helper function taking in a BoardObject and a coordinate to determine if the BoardObject can or cannot enter that coordiante (this will be used to differentiate arthropod and player collisions, as arthropods can sometimes pass through what the player cannot)
The current version of the level 1
scene has the UI overlay for reference
If you are above a boundary (you cannot go down by pressing down), but you press up and an arthro reverses your controls, you will still go down. This is because the rules are done in order, so board rules are called first, before the controls are reversed.
To fix this, create a new set of rules that are "late" and that cannot transform rules, only discard them, and have them act on actions after the "early" rules.
More intuitive than F
PushableObject
prefab !!Player.cs
for Player stuffPlayerObject.cs
and PlayerObject.cs.meta
The Board will count the number of bugs in ready and publicly store the number of bugs caught (to be changed by the player)
Inherits from Arthropod.cs
Bug
communicates w/ board whether it's caught and whether player will win
Catching the final Arthropod
in a level lets you win
Store a list of bools representing win conditions in the board.
class Board {
...
private List<bool> winConditions = new List<bool>();
...
}
A BoardObject
can allocate a win condition and get an index to the winCondition, which it can then use to set it to true if the condition is met or false otherwise (default false).
class Board {
...
// add a bool to winconditions and return its index
public int AllocateWinCondition();
// set the win condition and test for whether all are met
// if all are met, then gg
public int SetWinCondition(int index, bool value);
...
}
So a bug could do something like this
class Bug {
...
private int winCondition;
void Start(){
winCondition = board.AllocateWinCondition();
}
public void OnCaught(){
board.SetWinCondition(winCondition, true);
}
...
}
Set up linear dialogue system with Yarn Spinner
Follow instructions for Yarn Spinner 2.0+ https://docs.yarnspinner.dev/
Movement will be handled by the base BoardObject
class, which will move at the end of each turn (OnEndTurn
) according to the list of movement actions in actions
. The duration per move and time since end of move are both available in the Board class.
Resources:
Unless range is infinite, then no need for outline
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.