EDIT:
Also on structs maybe it could be like:
Code: Select all
.equ NUM_PLAYERS 4
.struct struct_players
.res x 2
.res y 2
.res life
.endstruct
.res players struct_players NUM_PLAYERSModerator: Moderators
Code: Select all
.equ NUM_PLAYERS 4
.struct struct_players
.res x 2
.res y 2
.res life
.endstruct
.res players struct_players NUM_PLAYERSCode: Select all
; Define a data structure
.datastruct object
.res x 2 ; X position in pixels / 16
.res y 2 ; Y position in pixels / 16
.res vx 1 ; X velocity in pixels / 16
.res vy 1 ; Y velocity in pixels / 16
.res shape 1 ; Shape number
.enddatastruct
; Create a single object instance
.struct player object
; Create a table of objects
.equ MAX_OBJECTS 16
.struct game_objects object MAX_OBJECTS
; Define an initialized object instance
.data some_obj object x=0x0170, y=0x00a0, vx=48, vy=0, shape=7
; Define an initialized table of objects
.table object_templates object
.data x=0x0170, y=0x00a0, vx=48, vy=0, shape=7
.data x=0x0170, y=0x00a0, vx=96, vy=0, shape=4
.endtable
Code: Select all
.table object_templates object
.data x=0x0170, y=0x00a0, vx=48, vy=0, shape=7
.data x=0x0170, y=0x00a0, vx=96, vy=0, shape=4
.endtableCode: Select all
.scope object_templates
x: .word 0x0170, 0x0170
y: .word 0x00a0, 0x00a0
vx: .byte 48, 96
vy: 0, 0
shape: 7, 4
.endscope