data structure
Tunnels consist of series of rings of rocks.
The following arrays hold the information for the rings:
tunnel_loc#(MAX_TUNNEL_NUM,3) : store the coordinate of the center point of ring
tunnel_orix#(MAX_TUNNEL_NUM) : store the x-direction of ring
tunnel_oriy#(MAX_TUNNEL_NUM) : store the y-direction of ring
tunnel_rock(MAX_TUNNEL_NUM,2) : store the IDs of the rocks which consist of each rings
old_tun(MAX_TUNNEL_NUM/10) : store the IDs of the rings which were in the scene in the last iteration
new_tun(MAX_TUNNEL_NUM/10) : store the IDs of the rings which newly enter into the scene in this iteration
delete_tun(MAX_TUNNEL_NUM/10) : store the IDs of the rings which go out of the scene in this iteration
reuse_tun(MAX_TUNNEL_NUM/10,2) : store the IDs of the rocks which go out of the scene in this iteration to reuse the rocks later
p_loc#(10,3) : store the locations of pieces of cheese
p_taken(10) : indicate whether the piece of cheese is taken by mouse or not
b_loc#(30,3) : store the location of bombs
b_stat(30) , bomb_on(30) : store the states of bombs
bomb_mod(30) : indicate if the state of each bomb changes or not
get_bomb_id(3) : store the IDs of bombs which are taken by a character
structure for main loop
finite state machines
Network Connection
We just used the "default net game" command for network connection and "send net message string" command to send data packets to another machine. When one machine sends successive data packets to another, some packets are lost from time to time, so we tried to keep the transfer rates of data packets below the appropriate level, but it doesn't seem be a consistent solution. We need to increase socket buffer size, but darkbasic has no control for this. Maybe we could try change the network configuration of the windows system instead.
home || summary || elements || tunnels || mechanics || visuals || sound || sketches || storyboards || screenshots || opening || game.