Module Helpers


module Helpers: sig  end
Nice helpers

val add_video_mode_var : (unit -> unit) -> unit
add_video_mode video_change_fun adds a the variable "video_mode" to the parser and sets video_change_fun to be called whenever the video mode is changed. The two params received is the new resolution.
val add_chat : unit -> unit
add_chat () adds command "say" to the console
val vertical_split : unit -> Video.t list
vertical_split () returns a list of contexts for players. The screen is split to equal parts one for every local_player.
val main : (unit -> unit) -> (unit -> unit) -> unit
main frame_delay new_frame_fun draw_fun is the mainloop
Returns number of frames that happened
val main_no_quit : (unit -> unit) -> (unit -> unit) -> int
val delay : float Pervasives.ref
dalay is the reference to the delay beetween frames. It is available from the console
val add_net_action : ?mode:Input.mode -> string -> (int -> unit) -> (int -> unit) -> unit
Adds a server action. add_action and add_action_pair are usually better
val add_action : ?mode:Input.mode -> bool -> string -> int -> bool
add_action ?more broadcast key adds an action that may be optionally broadcasted. Returns a function taking player number and returning true if the action is performed or false if it is not
val add_action_pair : ?mode:Input.mode -> bool -> string -> string -> int -> int
add_action_pair ?mode broadcast start_key end_key adds an action pair that may be optionally broadcasted.
Returns a function taking player number and returning 1 if only start_key is pressed, -1 if only end_key is pressed and 0 in other cases
val add_action_group : ?mode:Input.mode -> bool -> string list -> int -> string list
add_action_group ?mode broadcast keys_list adds an optionally broadcasted group of actions.
Returns a function taking player number and returning the list of actions that were pressed for a part of the time since the last call.
val add_sprite_set_info : 'a Sprite.t Serialize.t -> 'a Sprite.set -> unit
add_sprite_set_info sprite_serializer set adds a net synchronization message, that will synchronize set in new connected clients. See Net.add_synchronizer