Learning With Games
Project RU is a game where players must create their own bots and then face them against each other in combat. The winner is no longer determined by who has the fastest reflexes but instead the player who writes the smartest bot!
It only takes a few lines of code to get started building a bot. After that the code can be as complex or as simple as the player wants!
//define the bot class
var superbot = function() {
//pick a name for the bot
this.name = "SuperBot";
//the weapons you'd like to use
this.weapons = ["lazer", "burst", "tracker"];
//and a public method to update the bot
this.update = function(game, bot) {
//do something here to control your bot for
//example, move or shoot or look where the
//enemy bot is positioned
bot.x += bot.maxSpeed;
};
};
hugoware.net is licensed under a
158
Subscribers822
Followers142
Following156
favorites8
Repos16
Gists45
Followers11,465
Reputation15
Gold36
Silver61
Bronze