|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
New Game.
Hi, im an experienced flash user, but im a n00b when it comes to complex ActionScripting. And im looking to make a game called Connect The Dots, (if you dont know what that is, its the game where 2+ people draw lines on a grid of dots, and the person with the most boxes completed at the end, wins) And i need to know the fallowing:
How to tell the game to know when a user wants to make a line. How to tell the game to know when a user has completed a box. How to tell the game to know to put the user's initials in every box they make. And how to tell the game to know to give the user a extra turn after he/she has made a box. Any suggestions? |
|
#2
|
|||
|
|||
|
i would use the drawing API do dynamically create your lines. have them click on the dots (which will be hotspots)...then as long as their mouse is down, use some trig to figure out which dot is closest to the dot they clicked on, but only in a one dot radius.
When they let got of the mouse, have flash make them let up on another dot. If they let up on the dot, draw the line, if not, clear the line and let them draw somewhere else. i would store all of the dots and lines in a multidimensional array. Do a loop through the array any time it changes. So, if you had a 4x4 box, my array would look like: Code:
board = [[0,0,0,0], [0,0,0,0], [0,0,0,0], [0,0,0,0]]; And then when a user clicks on a button, and draws a line, change the 0's to 1's. Code:
board = [[1,1,0,0], [0,0,0,0], [0,0,0,0], [0,0,0,0]]; this would be a line from the first and second dot. Using this method, you could also check to look for squares. So, after a person moves, check to see if there are any new squares. depending on who's turn it is, attach or create a letter or icon representing that player. So, if a new box exists, set the turn back to the same player... that's one method to approach it... -bret |
|
#3
|
|||
|
|||
|
I have a 17 by 17 dots, and i've put the "board" code in the frame its on, but how do i assign the buttons?
|
![]() |
| Viewing: Dev Shed Forums > Web Design > Flash Help > New Game. |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|