Loading...
Logo
Processing Forum
wil993's Profile
1 Posts
0 Responses
0 Followers

Activity Trend

Last 30 days
Show:
Private Message
    Hey,

    I am creating a battleships game at the moment and really struggling with one bit...

    I need to draw the "ships" (just rect's atm) using an addShipAt function I will include the code I have as that probably makes more sense than my ramblings!

    Main Battleships tab

    1. void mousePressed()
    2. {
    3. println((mouseX/50)+0+","+((mouseY/50)+0));
    4. int gridX = mouseX/50;
    5.  int gridY = mouseY/50;
    6. myBoard.addShipAt(gridX,gridY,ships[currentShip]);

    7. currentShip++;
    8. }



    Board Class

    1. public void addShipAt(int gridX, int gridY, Battleships.ships[currentShip]) {
    2.     x = gridX;
    3.     x = gridY;
    4.     }
    5.     
    I just keep getting errors however I write it atm I am getting this:

    TRIPLE_DOT, found '['

    Any help would be much appreciated!
    Thanks
    Will