Coder Social home page Coder Social logo

srs-team-bug's People

Contributors

alexanderc5 avatar azhu1223 avatar brad-lowe avatar fpeng-02 avatar hiccuphan avatar ketexon avatar kkev1229 avatar napstaboo avatar pinlunix avatar rh5140 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

srs-team-bug's Issues

Rule manager that filters and modifies actions

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.

Transition between levels by returning to map

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.

Boundaries for player movement in board

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

Persistent State

Creation of Persistent State

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

Loading from disk (low priority)

Save/load from persistentDataPath

Game State Loading/Unloading (low priority)

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.

Connection to the Map (low priority, dependent on map impl.)

Need to store the last position on the map if the map is to be controlled by arrow keys

Connection to Winning

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.

Connection to Inventory

Storing the inventory data in this state so that it is accessible from all

Add sprite to dialogue box

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).

Not disconnecting event listeners can cause late destruction

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.

Capture bug on overlap

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

Inventory prototype

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.

Pause State

New state in the board that represents nothing happening

Code

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

UI for pausing with, for example, go back to map button and resume button.

Bug implementation

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.

Collidables

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)

Bug: collidable and boundary checking rules run before other rules (create separate set of "late" rules)

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.

Push pushable objects

  • Players and pushable objects can push pushable objects
  • Bugs cannot push or be pushed
  • Pushable object stops when pushed into something that is not pushable
  • Pushing class as tag
  • Attach script to PushableObject prefab !!

Bug counting

The Board will count the number of bugs in ready and publicly store the number of bugs caught (to be changed by the player)

Win condition

Bug communicates w/ board whether it's caught and whether player will win

Catching the final Arthropod in a level lets you win

Potential Implementation

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);
    }
    ...
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.