data structure

1. arrays for tunnels

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

2. arrays for pieces of food/portal

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

3. arrays for bombs

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

  1. Compute cycle time for consistent execution speed
  2. Manage key inputs
  3. Get the current position of character and send it to the other machine
  4. Draw radar
  5. Set up the boundary of space
  6. Camera and light setup
  7. Manage and draw tunnel
  8. Manage bombs
  9. Manage cheese
  10. Check and control the movement of character (fall down, walk on the tunnel floor, change the mode of movement and so on)
  11. Move rocks for digging tunnel continuously
  12. Receive data from the other machine

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.