class WAD::Demo

Overview

A doom demo which saves player input states

Included Modules

Defined in:

wa-cr/wad/wad-data/demo.cr
write.cr

Constructors

Class Method Summary

Instance Method Summary

Instance methods inherited from module WritingAdditions::Demo

write(file : String | Path) : UInt32
write(io : IO) : UInt32
write

Constructor Detail

def self.parse(filename : String | Path) : Demo #

Parses an file in a demo format

Reads an file and puts out a demo:

my_demo = WAD::Demo.parse("Path/To/Demo")

[View source]
def self.parse(io : IO) : Demo #

Parses an io in a demo format

Reads an io and puts out a demo:

File.open("Path/To/Demo") do |file|
  my_demo = WAD::Demo.parse(file)
end

[View source]

Class Method Detail

def self.is_demo?(io : IO) #

Checks if the demo is of doom version 1,9

Returns true if an io is a demo:

File.open("Path/To/Demo") do |file|
  if WAD::Demo.is_demo(file)
    puts "Is Demo"
  else
    puts "Is not Demo"
  end

[View source]

Instance Method Detail

def clone #

Returns a copy of self with all instance variables cloned.


[View source]
def episode : UInt8 #

Always 1 for Doom 2


[View source]
def episode=(episode : UInt8) #

Always 1 for Doom 2


[View source]
def fast : Bool #

non-zero value implies use of -fast


[View source]
def fast=(fast : Bool) #

non-zero value implies use of -fast


[View source]
def game_version : UInt8 #

109 for version 1.9


[View source]
def game_version=(game_version : UInt8) #

109 for version 1.9


[View source]
def input_actions : Array(InputAction) #

A series of player actions for each tic encoded in 4 bytes.


[View source]
def input_actions=(input_actions : Array(InputAction)) #

A series of player actions for each tic encoded in 4 bytes.


[View source]
def map : UInt8 #

The map


[View source]
def map=(map : UInt8) #

The map


[View source]
def multiplayer_mode : UInt8 #

1 means deathmatch, 2 altdeath, 0 is used for single-player or cooperative multi-player


[View source]
def multiplayer_mode=(multiplayer_mode : UInt8) #

1 means deathmatch, 2 altdeath, 0 is used for single-player or cooperative multi-player


[View source]
def nomonsters : Bool #

non-zero value implies use of -nomonsters


[View source]
def nomonsters=(nomonsters : Bool) #

non-zero value implies use of -nomonsters


[View source]
def player1 : Bool #

Set to 1 if player 1 present


[View source]
def player1=(player1 : Bool) #

Set to 1 if player 1 present


[View source]
def player2 : Bool #

Set to 2 if player 1 present


[View source]
def player2=(player2 : Bool) #

Set to 2 if player 1 present


[View source]
def player3 : Bool #

Set to 3 if player 1 present


[View source]
def player3=(player3 : Bool) #

Set to 3 if player 1 present


[View source]
def player4 : Bool #

Set to 4 if player 1 present


[View source]
def player4=(player4 : Bool) #

Set to 4 if player 1 present


[View source]
def player_pov : UInt8 #

Which player's point of view to use, zero-indexed (0 means player 1)


[View source]
def player_pov=(player_pov : UInt8) #

Which player's point of view to use, zero-indexed (0 means player 1)


[View source]
def respawn : Bool #

non-zero value implies use of -respawn


[View source]
def respawn=(respawn : Bool) #

non-zero value implies use of -respawn


[View source]
def skill_level : UInt8 #

Values 0 through 4 indicate "I'm too young to die" through "Nightmare!", respectively.


[View source]
def skill_level=(skill_level : UInt8) #

Values 0 through 4 indicate "I'm too young to die" through "Nightmare!", respectively.


[View source]