Post by Zidane on Oct 30, 2013 9:58:35 GMT -5
Hi Y'all,
So I'm trying to put together a self-built version of Tetra Master, and one day be able to put it out on the web and play online against people
Here's the pseudocode I have so far... This will be ongoing, and I'd love anyone's help that wishes to! (I haven't coded in a looooong time, but what I have has been Java, so it's kind of in that vein)
So I'm trying to put together a self-built version of Tetra Master, and one day be able to put it out on the web and play online against people
Here's the pseudocode I have so far... This will be ongoing, and I'd love anyone's help that wishes to! (I haven't coded in a looooong time, but what I have has been Java, so it's kind of in that vein)
Tetra Master Pseudocode
Object Card; //A card or a "Blank" space, which will just be an un-interactable card
Object Board; //The Game Board
Object Player; //Two players, playing the game
private Random random; //used for populating arrows
Card { //A card will have an array of 9 boxes (3x3), 8 of which can have "Arrows" (along the outside). Middle "box" will never have anything
boolean[3][3] arrowGrid;
backgroundImage (don't know how to classify this)
boolean hasArrow;
//When a card is created, have to give it a certain amount of arrows, etc
populateArrows() {
for(int i = 0; i < 3; i++)
for(int j = 0; j < 3; j++)
arrowGrid[i][j].hasArrow = random.nextBoolean; //iterate through the array, saying whether each cell in the grid has an arrow or not...
arrowGrid[1][1].hasArrow = false; //... and make it so that the middle cell never has an arrow
}
}
Board { //The board will have 16 (4x4) cells, with up to 5 "Blank" (unplayable) spaces
//Maybe have a method that rolls a 0-5 random number and that's how many spaces we put //in in random places?
//Set up normal places to be containers for cards
}
Player{
//needs an inventory of all his/her cards
}
//Maybe have a class for out-of-game/inventory management/etc., then a class for the game itself?
Class Game{
//Sets up board
//Players 1 and 2 grab 5 cards each from inventory
//Game start; roll randomly to see who goes first
/* need to find a way for the cards to "See" each other, to see whether they "Fight" (when two arrows oppose each other), "Take" (when arrow points to blank space when card is placed), or don't
interact; Game is over when no cards remain */
}