2D Arrays Help?
Author |
Message |
navalgazer
|
Posted: Tue May 19, 2015 3:26 pm Post subject: 2D Arrays Help? |
|
|
What is it you are trying to achieve?
So using an 2D array I'm trying to make a board game. When the user rolls ______ then the character token will transport to such spot.
So drawing the grid how would I refer to each spot as an array cell. So let's say I'm on space one and roll a six. How would I make the thing transport
to space 6.
Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
setscreen ("graphics:1000;1000")
for i : 1 .. 770 by 70
Draw.Line (0 + i, 0, 0 + i, 700, 7)
Draw.Line (0, 0 + i, 700, 0 + i, 7)
end for |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
Raknarg
![](http://compsci.ca/v3/uploads/user_avatars/3745510004d8be6689b92f.jpg)
|
Posted: Tue May 19, 2015 3:49 pm Post subject: RE:2D Arrays Help? |
|
|
You'll have to be more specific on how your board works. Do you mean something like monopoly? |
|
|
|
|
![](images/spacer.gif) |
navalgazer
|
Posted: Tue May 19, 2015 7:01 pm Post subject: RE:2D Arrays Help? |
|
|
Essentially it's a game of snakes and ladder |
|
|
|
|
![](images/spacer.gif) |
navalgazer
|
Posted: Sat May 23, 2015 5:32 pm Post subject: RE:2D Arrays Help? |
|
|
So would anyone know how to give each box a position so that when I get a value for the dice, the token will move ___ amount of spaces? |
|
|
|
|
![](images/spacer.gif) |
Raknarg
![](http://compsci.ca/v3/uploads/user_avatars/3745510004d8be6689b92f.jpg)
|
Posted: Sat May 23, 2015 6:50 pm Post subject: RE:2D Arrays Help? |
|
|
pm me as a reminder, I'm at work right now. |
|
|
|
|
![](images/spacer.gif) |
navalgazer
|
Posted: Wed May 27, 2015 4:11 pm Post subject: RE:2D Arrays Help? |
|
|
pm~ |
|
|
|
|
![](images/spacer.gif) |
|
|