Giter VIP home page Giter VIP logo

episode2's Introduction

Episode2 - Superfight

A Game engine with Fighters, turns, and Matches

Panda Level

  1. Read through the code when you start with Match.new
  2. Inside the Match when it is fighting, output the winner of each Turn using something like:
13.times.map do
  turn = Turn.new ...
 	if @opponent_a.strike == turn.winner
		puts "Opponent A  -- #{@opponent_a.name} -- won"
	else
		puts "Opponent B  -- #{@opponent_b.name} -- won"
	end
end

Tiger Level

  1. Instead of randomly selecting the winner of a turn, use the Move's ranking to determine a winner
  2. Refactor the code that determines which fighter won a round to make it easy:
def winner_for_round(turn, opponent_a, oppoenent_b)
 ...
end
  1. Create a Match.replay method that loops through the turns and outputs to the screen a listing of the turns and who won

Eagel level

  1. Strike vs Strike and Strike vs Block should let the higher rank win
  2. Block vs Block should pick a random winner

Copyright: Jesse Wolgamott, MIT License (See LICENSE)

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.