imp1 / ai_football Goto Github PK
View Code? Open in Web Editor NEWA football management game where you write the AI for your players
A football management game where you write the AI for your players
people yelling at footballers on TV telling them what do
people yelling at fifa game telling players what to do
"complete control over your team's every move"
"learn to program!"
"master the beautiful game!"
Have a Domain Specific Language for the AI?
Example:
function nearest_team_mate() -> Player
all_team_mates = $game.players[$self.team]
all_team_mates.sort { |a, b| -> bool
distance_squared_a = (a.position - $self.position):magnitude_squared()
distance_squared_b = (b.position - $self.position):magnitude_squared()
return distance_squared_a < distance_squared_b
}
return team_mates.first
end
function goal_mouth() -> Position
return $game.pitch.positions.goal[$self.team]
end
context goal_kick (goal_kick_team)
return if goal_kick_team != $self.team
pass("punt", nearest_team_mate($self, $game))
end
context kickoff (kickoff_team)
moveTowards(goal_mouth())
end
context interrupt (command, shouter)
// Ignore all commands
end
context goal_kick (goal_kick_team)
return if goal_kick_team != $self.team
pass("punt", nearest_team_mate($self, $game))
end
context penalty (penalty_team)
moveTowards(goal_mouth())
// TODO: dive in a direction
end
context tick
if $self.has_ball
if $self.holding_ball // will only ever by true for goalkeepers
$self:pass("throw", nearest_team_mate($self, $game)) // or roll?
else
$self:pass("drop", $self)
$self:pass("sidefoot", nearest_team_mate($self, $game))
end
else
// TODO: if shot then try to save
// TODO: else position self on goal line at approp place
end
end
as well as recording goals, record other events.
but also useful data that wouldn't be shown to user until better processed
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.