Giter Club home page Giter Club logo

battle's Introduction

We have now implemented a handful of User Stories. At the moment, our Battle app is going through the motions, but nothing is really happening. Our next User Story asks us to do something about that:

As Player 1, So I can start to win a game of Battle, I want my attack to reduce Player 2's HP

This User Story is more complex than previous ones. It requires us to track HP, and to manipulate it on a per-player basis. This is far more than a simple controller or router should handle. Before we can reasonably implement it we should refactor our code to use some Application logic stored in a Model layer. We can store our Model layer in /lib, and access it from our controller. This is known as a Separation of Concerns.

In this challenge, you will create a Player class in the Model layer. It will interact with your existing controller code.

Challenge Setup

If the Controller action is complex - for example, it stores complex data (i.e. more than simple strings) or creates new objects - it should pass that sort of job over to the Model (for now, anything in /lib). Our Model will be the kind of Object-Oriented program you have been building so far. You could imagine that the Controller provides web access to your Ruby code from a browser.

battle's People

Contributors

daniel57910 avatar

Watchers

James Cloos avatar

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.