Game for Master System

VersionDateByDownload
1.0020 Dec 2010thematrixeatsyouCardiacArrest-SMS-1.00.zip (102KB) (includes source)
Version
1.00
Platform
SMS
Type
Game
Released
20101220
By
thematrixeatsyou
Screenshots
1
Source
included
ShowOldVersions
false

//:ForumTopic:12345

Entry to Ludum Dare #19.

Readme

Cardiac Arrest: Screw-it-I'm-uploading edition
by Ben "GreaseMonkey" Russell, 2010
for Ludumdare #19

ok this game is called "Cardiac Arrest" because it's just about to give me cardiac arrest
i've mangaged to release it though but in a really crap state with 2 hours to spare
it's playable, though, and i don't think there's any bugs in it
and yes, they are supposed to be able to shoot each other

story:
while you're doing a thing, you discover a nuclear bomb somewhere
your aim is to return it to the address on the bomb
unfortunately people want the bomb so they'll shoot you to get it
more unfortunately the best they can do is shoot the bomb, exploderating it
the rest of the story is up to you to play out

buttons:
up,down,left,right are obvious
1 and 2 do nothing
you can't pause
reset button is ignored, flick the power switch like a real man

you will need WLA-DX if you want to compile this


tech info follows, this should have everything ever

# Map format
############

levels are stored line-by-line, upside-down due to the nature of the engine.
however, in RAM, the data is stored straight.
the player starts on the bottom row, centred along X.

header:
	db rows_in_level

then we jump straight into data.

values:
00-6F: tile data
70-7F: repeat last value v-$70+2 times
80-EF: tile v&$7F stored twice
F0-FF: repeat last value v-$F0+2+16 times

row stops being parsed once address & $1F is equal to $00,
and address is saved in RAM for later reference.

# Tile type format (typeset)
############################

db reserved1
db entity_type
db flags
db actual_tile

reserved1:
	ignored.
entity_type:
	type this entity has.
	should be $FF if there is no entity.
flags:
	uh, these hold some values:
		bit 0 ($01): blocks player
		bit 1 ($02): blocks enemies
		bit 2 ($04): blocks player shots
		bit 3 ($08): blocks enemy shots
		bit 4 ($10):
		bit 5 ($20):
		bit 6 ($40):
		bit 7 ($80):
actual_tile:
	visible tile as taken from the lower bank using the upper palette.

# Entity set format (entset)
############################
dw pc_init_entity
db sprites_needed
db (unused)

pc_init_entity:
	called on init:
	ix = pointer to entity.

sprites_needed:
	how many contiguous sprites are needed.

# Entity info in RAM
####################

db entity_type
db wait
dw pc_frame_update
dw pc_frame_shot
db ent_x
db ent_y
db ent_vx
db ent_vy
db state
db state2
db sprite
db flags
db invuln
db health

there is 1 entity per sprite.

entity_type:
	the type of this entity.

wait:
	how many frames to wait before calling pc_frame_update again.

pc_frame_update:
	pointer to subroutine called each non-wait frame (if top byte is $FF, then ignore):
	ix = current entity

pc_frame_shot:
	pointer to subroutine called when shot (if top byte is $FF, then ignore):
	ix = current entity
	iy = other entity

ent_x, ent_y:
	"absolute" position on map.

ent_vx, ent_vy:
	signed velocity.

invuln:
	how many frames to wait before this becomes vulnerable again.
	if bit 0 is set, this sprite is invisible.

flags:
	uh, these ALSO hold some values:
		bit 0 ($01): eats bullets
		bit 1 ($02): takes hits
		bit 2 ($04): show sprite

state:
	current state specific to the entity code.

state2:
	extra storage for state if you want it.

entity 0 is always the player.

it is advised that you try to load only one entity per row.

# Music format
##############

dw relative_pointer_to_stream

then a table of relative pointers follow, this is for the $40-terminated lookup table

then the strings for the lookup table

then the stream follows...
	if the value is $01, then don't write anything to the PSG.
	if bit 0 is set, it's a 1-byte lookup.
	if bit 0 is clear, it's a 2-byte lookup, low then high.
	if the 2-byte lookup is $FFxx, then reset the stream.


Return to top
0.064s