Closed Pamblam closed 5 years ago
Hi! I'd be happy to help
That would be awesome, i'd appreciate it.
So I see someone else already worked on this, thank you for the opportunity though.
@MiguelGT98 - Too many people working on this to keep track of who said what. I assumed the person who commented on the issue was the person who submitted the PR. By all means though, feel free to make any other changes you think would make things look or feel better and submit a PR.
In the form where the user gives his name we need to add more options.
For now the second player will always be a bot (later I'll create a server so two players can play each other live from different computers)
At the top of
game.js
there is an array calledsneks
. It starts out with a snek instance in it, but you will have to change it to start with an empty array then add each player to that array after the user submits the form. The first user in that array is always the live player. If there will be two players add a second snek instance to that array.The Snek contructor now has two arguments. Add a player like this..
sneks.push((player_type, color));
player_type
should be 'live' or 'bot'. The first instance in the array should always be 'live' and the second should always be 'bot'.color
should be one of the following: 'red', 'blue', 'yellow', or 'brown'Whatever the user chooses for the game mode should be set to the global variable:
game_mode
(either 'stamina' or 'longest_wins') - if stamina is chosen the first player to run into something loses. if longest wins, whoever has the longest snek at the end wins.I've already written the bot and the game mode logic. All we need is this form to be implemented as described above.