Loading...
Processing Forum
Recent Topics
All Forums
Screen name:
wil993
wil993's Profile
1
Posts
0
Responses
0
Followers
Activity Trend
Last 30 days
Last 30 days
Date Interval
From Date :
To Date :
Go
Loading Chart...
Posts
Responses
PM
Show:
All
Discussions
Questions
Expanded view
List view
Private Message
Struggling with function drawing a rectangle in an array for battleships game
[2 Replies]
08-Dec-2011 05:28 PM
Forum:
Programming Questions
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
void mousePressed()
{
println((mouseX/50)+0+","+((mouseY/50)+0));
int gridX = mouseX/50;
int gridY = mouseY/50;
myBoard.addShipAt(gridX,gridY,ships[currentShip]);
currentShip++;
}
Board Class
public void addShipAt(int gridX, int gridY, Battleships.ships[currentShip]) {
x = gridX;
x = gridY;
}
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
«Prev
Next »
Moderate user : wil993
Forum