A lot of minor updates. But still broken.

This commit is contained in:
Glenn Y. Rolland 2008-02-22 23:49:21 +01:00
parent a835335b0b
commit 2300b6ef13
8 changed files with 83 additions and 33 deletions

View file

@ -1,5 +1,12 @@
(* vim: set st=2 sw=2 et : *)
type game_t = {
level: Level.level_t ;
players: Player.player_t array ;
(* monsters: Monster.monster.t array ; *)
timeline : Timeline.timeline_t ;
}
let rec refresh_input () =
(* poll events *)
let get_handler_fun ev =

46
Level.ml Normal file
View file

@ -0,0 +1,46 @@
type item_t =
| Item_bonus
| Item_malus
| Item_none
;;
type block_t =
| Block_solid
| Block_reakable
| Block_none
;;
type tileset_t =
| Tileset_winter (* ice cubes, *)
| Tileset_summer (* mice, *)
| Tileset_brick
| Tileset_ufo (* rhombicuboctaedron, robots, etc. *)
| Tileset_library (* crayon, books, papers, *)
;;
type level_t = {
size_x : int ;
size_y : int ;
items : (item_t ref) array array ;
blocks : (block_t ref) array array ;
background: string ; (* FIXME: animated background *)
foreground: string ; (* FIXME: animated foreground *)
tileset : tileset_t;
};;
let default_x = 17;;
let default_y = 11;;
let create () = {
size_x = default_x ;
size_y = default_y ;
items = Array.make_matrix default_x default_y (ref Item_none) ;
blocks = Array.make_matrix default_x default_y (ref Block_none) ;
tileset = Tileset_winter;
background = "none" ;
foreground = "noon" ;
}
;;

View file

@ -2,7 +2,9 @@ PROGRAMS=justnukeit
justnukeit_OBJS= \
Position \
Maze \
Timeline \
Menu \
Level \
Player \
Joystick \
Keyboard \

31
Maze.ml
View file

@ -1,31 +0,0 @@
type item_t =
| Bonus
| Malus
| NoItem
;;
type block_t =
| Solid
| Breakable
| NoBlock
;;
type t = {
mutable size_x : int ;
mutable size_y : int ;
mutable items : item_t array array ;
mutable blocks : block_t array array ;
};;
let default_x = 10;;
let default_y = 10;;
let create () = {
size_x = default_x ;
size_y = default_y ;
items = Array.make_matrix default_x default_y NoItem ;
blocks = Array.make_matrix default_x default_y NoBlock ;
}
;;

16
Menu.ml Normal file
View file

@ -0,0 +1,16 @@
type widget_t =
| Menu_text of string
| Menu_image of
| Menu_clickable
;;
type menu_t = {
widgets : widget_t list ;
click_handle : Position.position_t -> unit ;
keyboard_handle : string (* Keyboard.a *)
;;
let handle_click pos =

View file

@ -1,5 +1,5 @@
type t = {
type player_t = {
mutable name : string ;
mutable lifes : int ;
mutable position : Position.t;

8
Timeline.ml Normal file
View file

@ -0,0 +1,8 @@
type timeslice_t = {
(* Action *)
label: string ;
}
type timeline_t = timeslice_t list

2
menu.gui Normal file
View file

@ -0,0 +1,2 @@
menu "main" {
label