class WAD::Demo
- WAD::Demo
- Reference
- Object
Overview
A doom demo which saves player input states
Included Modules
Defined in:
wa-cr/wad/wad-data/demo.crwrite.cr
Constructors
-
.parse(filename : String | Path) : Demo
Parses an file in a demo format
-
.parse(io : IO) : Demo
Parses an io in a demo format
Class Method Summary
-
.is_demo?(io : IO)
Checks if the demo is of doom version 1,9
Instance Method Summary
-
#clone
Returns a copy of
self
with all instance variables cloned. -
#episode : UInt8
Always 1 for Doom 2
-
#episode=(episode : UInt8)
Always 1 for Doom 2
-
#fast : Bool
non-zero value implies use of -fast
-
#fast=(fast : Bool)
non-zero value implies use of -fast
-
#game_version : UInt8
109 for version 1.9
-
#game_version=(game_version : UInt8)
109 for version 1.9
-
#input_actions : Array(InputAction)
A series of player actions for each tic encoded in 4 bytes.
-
#input_actions=(input_actions : Array(InputAction))
A series of player actions for each tic encoded in 4 bytes.
-
#map : UInt8
The map
-
#map=(map : UInt8)
The map
-
#multiplayer_mode : UInt8
1 means deathmatch, 2 altdeath, 0 is used for single-player or cooperative multi-player
-
#multiplayer_mode=(multiplayer_mode : UInt8)
1 means deathmatch, 2 altdeath, 0 is used for single-player or cooperative multi-player
-
#nomonsters : Bool
non-zero value implies use of -nomonsters
-
#nomonsters=(nomonsters : Bool)
non-zero value implies use of -nomonsters
-
#player1 : Bool
Set to 1 if player 1 present
-
#player1=(player1 : Bool)
Set to 1 if player 1 present
-
#player2 : Bool
Set to 2 if player 1 present
-
#player2=(player2 : Bool)
Set to 2 if player 1 present
-
#player3 : Bool
Set to 3 if player 1 present
-
#player3=(player3 : Bool)
Set to 3 if player 1 present
-
#player4 : Bool
Set to 4 if player 1 present
-
#player4=(player4 : Bool)
Set to 4 if player 1 present
-
#player_pov : UInt8
Which player's point of view to use, zero-indexed (0 means player 1)
-
#player_pov=(player_pov : UInt8)
Which player's point of view to use, zero-indexed (0 means player 1)
-
#respawn : Bool
non-zero value implies use of -respawn
-
#respawn=(respawn : Bool)
non-zero value implies use of -respawn
-
#skill_level : UInt8
Values 0 through 4 indicate "I'm too young to die" through "Nightmare!", respectively.
-
#skill_level=(skill_level : UInt8)
Values 0 through 4 indicate "I'm too young to die" through "Nightmare!", respectively.
Instance methods inherited from module WritingAdditions::Demo
write(file : String | Path) : UInt32write(io : IO) : UInt32 write
Constructor Detail
Parses an file in a demo format
Reads an file and puts out a demo:
my_demo = WAD::Demo.parse("Path/To/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
Class Method Detail
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
Instance Method Detail
A series of player actions for each tic encoded in 4 bytes.
A series of player actions for each tic encoded in 4 bytes.
1 means deathmatch, 2 altdeath, 0 is used for single-player or cooperative multi-player
1 means deathmatch, 2 altdeath, 0 is used for single-player or cooperative multi-player
Which player's point of view to use, zero-indexed (0 means player 1)
Values 0 through 4 indicate "I'm too young to die" through "Nightmare!", respectively.
Values 0 through 4 indicate "I'm too young to die" through "Nightmare!", respectively.