Skip to content

Custom Pyramid Creation Guide

Millie Macdonald edited this page Jan 18, 2017 · 1 revision

It's easy to make your own custom pyramid shapes! Pyramid shapes are defined in an ArrayList of PyramidCardLocations. The PyramidCardLocation constructor takes 3 int values: (x, y, z) where x and y correspond with x and y coordinates on screen and z describes a PyramidCardLocation's position in the 3rd dimension. A PyramidCardLocation with a z index of 0 will appear on top of one with an index of 1.

Step 1

Open the PyramidType enum in the pyramid package. Add your new pyramid's name to the list of constants at the top of the file. After the name, state the card capacity of the pyramid.

public enum PyramidType {
DIAMOND(buildDiamond()),
INVERTED(buildInverted()),
SQUARE(buildSquare()),
TRIANGLE(buildTriangle())
PYRAMIDNAMEHERE(buildPyramidName()); //<----your pyramid's name here

Step 2

Once your pyramid has been add to the generateShape method head down to bottom of PyramidType and great a new private like the following:

private ArrayList<PyramidCardLocation> buildNewPyramid(ArrayList<PyramidCardLocation> cardLocations){

Inside the new pyramid's private method use a similar layout to the following to create a pyramid layout of your choosing.

//Row 1
cardLocations.add(new PyramidCardLocation(0, 0, 0);
//Row 2
cardLocations.add(new PyramidCardLocation(0 - (CARD_SPACING/2), ROW_SPACING, 1);
cardLocations.add(new PyramidCardLocation((CARD_SPACING/2), ROW_SPACING, 1);
//Row 3
cardLocations.add(new PyramidCardLocation(0 - CARD_SPACING, ROW_SPACING * 2, 2);
cardLocations.add(new PyramidCardLocation(0, ROW_SPACING * 2, 2);
cardLocations.add(new PyramidCardLocation(CARD_SPACING, ROW_SPACING * 2, 2);

It is recommended that CARD_SPACING and ROW_SPACING are used where appropriate instead of hardcoding x and y values as both values provide consistency across all different pyramid layout types.

CARD_SPACING - a variable used along the x domain, if added to the previous card's x coordinate will produce an x value for the next card that has a space between itself and the previous card. For example - A card has the x value of 0 and adding CARD_SPACING to it will give the next card a space between each other to prevent overlapping.

ROW_SPACING - a variable that is used to maintain consistent differences in y values.

Current Designs

As of checkpoint one the enumerator class PyramidType currently contains eight different pyramid designs they are as follows DIAMOND, TRIANGLE, INVERSE, SQUARE, RECTANGLE, TRIANGLE_CORNER, TWO_TRIANGLE and TWO_INVERSE. To test these out, go to BasicMatchController -> setModelLocations and at the bottom there will be userPyramidType = PyramidType.TRIANGLE just change TRIANGLE to the desired PyramidType you wish to see.

Two new pyramids were created during the checkpoint 2 stage and their names are PYRAMID_TOP and EIGHT_CARD. PYRAMID_TOP is a top down view of pyramid that has a play path of 1-4-1 and EIGHT_CARD is an eight card pyramid that has a play path of 1-2-3-2.

Home

Saving and Loading

Statistics tracking

Game Play

APIs


Game Guide

Other Guides

Design Guides

Overviews

Features

Animations

Splash Screen & Create Account Screen

Player Account Settings

AI

Duck Dust


Brainstorming


Future Development


http://cultofthepartyparrot.com/parrots/partyparrot.gifhttp://cultofthepartyparrot.com/parrots/partyparrot.gifhttp://cultofthepartyparrot.com/parrots/partyparrot.gifhttp://cultofthepartyparrot.com/parrots/partyparrot.gif

Clone this wiki locally