mirror of
https://github.com/bman12three4/Factory-Game.git
synced 2024-06-25 21:29:28 +00:00
Add player tile
This commit is contained in:
parent
35070dfd58
commit
0dbe98e484
51
src/main.asm
51
src/main.asm
|
@ -3,6 +3,7 @@
|
|||
.include "world.inc"
|
||||
|
||||
.import draw
|
||||
.import itemdraw
|
||||
.import World
|
||||
.import ItemLoc
|
||||
.import itemRot
|
||||
|
@ -22,23 +23,23 @@ update: ldx #00 ; This loop just updates any animated tiles, like conveyors.
|
|||
update1:lda World,x
|
||||
cktile: cmp #00
|
||||
beq view
|
||||
cmp #02 ; Check if it is one of the three conveyor positions
|
||||
cmp #16 ; Check if it is one of the three conveyor positions
|
||||
beq rtconvJ ; Jump if it is
|
||||
cmp #04
|
||||
beq rtconvJ
|
||||
cmp #06
|
||||
beq rtconv2J ; Jump if it needs to be reset
|
||||
cmp #08
|
||||
beq lfconvJ
|
||||
cmp #10
|
||||
beq lfconvJ
|
||||
cmp #12
|
||||
beq lfconv2J
|
||||
cmp #14
|
||||
beq upassmJ
|
||||
cmp #16
|
||||
beq upassmJ
|
||||
cmp #18
|
||||
beq rtconvJ
|
||||
cmp #20
|
||||
beq rtconv2J ; Jump if it needs to be reset
|
||||
cmp #22
|
||||
beq lfconvJ
|
||||
cmp #24
|
||||
beq lfconvJ
|
||||
cmp #26
|
||||
beq lfconv2J
|
||||
cmp #10
|
||||
beq upassmJ
|
||||
cmp #12
|
||||
beq upassmJ
|
||||
cmp #14
|
||||
beq upassm2J
|
||||
jmp ckitem
|
||||
rtconvJ: jmp rtconv
|
||||
|
@ -48,7 +49,7 @@ lfconv2J:jmp lfconv2
|
|||
upassmJ: jmp upassm
|
||||
upassm2J:jmp upassm2
|
||||
ckitem: lda World,x
|
||||
cmp #14
|
||||
cmp #16
|
||||
bcs upitem
|
||||
jmp view
|
||||
upitem: lda ItemLoc,x
|
||||
|
@ -67,7 +68,11 @@ view: lda World,x
|
|||
lda TILECD
|
||||
lsr
|
||||
tax
|
||||
lda ItemLoc,x
|
||||
lda World,x
|
||||
cmp #16
|
||||
bcs iview
|
||||
jmp footer
|
||||
iview: lda ItemLoc,x
|
||||
sta TILENUM
|
||||
txa
|
||||
asl
|
||||
|
@ -78,9 +83,11 @@ view: lda World,x
|
|||
tax
|
||||
footer: inx
|
||||
cpx #100
|
||||
bne update1
|
||||
bne updateme
|
||||
rts
|
||||
|
||||
updateme:
|
||||
jmp update1
|
||||
|
||||
orecalc1:
|
||||
lda ItemRot,x
|
||||
cmp #00
|
||||
|
@ -147,7 +154,7 @@ rtconv: clc ; Add 2 to the tile type, moving it forward 1.
|
|||
sta World,x
|
||||
jmp ckitem
|
||||
|
||||
rtconv2:lda #02 ; Set the tile type back to 2, reseting it.
|
||||
rtconv2:lda #16 ; Set the tile type back to 2, reseting it.
|
||||
sta World,x
|
||||
jmp ckitem
|
||||
|
||||
|
@ -156,7 +163,7 @@ lfconv: clc ; Add 2 to the tile type, moving it forward 1.
|
|||
sta World,x
|
||||
jmp ckitem
|
||||
|
||||
lfconv2:lda #08 ; Set the tile type back to 2, reseting it.
|
||||
lfconv2:lda #10 ; Set the tile type back to 2, reseting it.
|
||||
sta World,x
|
||||
jmp ckitem
|
||||
|
||||
|
@ -169,7 +176,7 @@ upassm: clc
|
|||
sta World,x
|
||||
jmp ckitem
|
||||
|
||||
upassm2:lda #14
|
||||
upassm2:lda #12
|
||||
sta World,x
|
||||
jmp ckitem
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
; referenced to in the world array and drawn in the drawing loop.
|
||||
|
||||
TILES: ; A list of all of them is in the .inc file.
|
||||
.word GRASS
|
||||
.word GRASS, PLAYER
|
||||
.word INSERTER1_1, INSERTER1_2, INSERTER1_3
|
||||
.word ASSEMBLER1_1, ASSEMBLER1_2, ASSEMBLER1_3
|
||||
.word CONVEYOR1_1, CONVEYOR1_2, CONVEYOR1_3
|
||||
|
@ -41,6 +41,24 @@ GRASS:
|
|||
.byte $2a, $57, $2a, $55
|
||||
.byte $6a, $55, $2a, $5d
|
||||
|
||||
PLAYER:
|
||||
.byte $80, $80, $81, $80
|
||||
.byte $80, $a0, $87, $80
|
||||
.byte $80, $a0, $87, $80
|
||||
.byte $80, $a0, $87, $80
|
||||
.byte $80, $80, $81, $80
|
||||
.byte $80, $a0, $85, $80
|
||||
.byte $80, $88, $91, $80
|
||||
.byte $80, $84, $81, $81
|
||||
.byte $80, $80, $81, $80
|
||||
.byte $80, $80, $81, $80
|
||||
.byte $80, $a0, $84, $80
|
||||
.byte $80, $88, $90, $80
|
||||
.byte $80, $88, $90, $80
|
||||
.byte $80, $88, $90, $80
|
||||
.byte $80, $90, $a0, $80
|
||||
.byte $80, $90, $a0, $80
|
||||
|
||||
CONVEYOR1_1:
|
||||
.byte $0, $0, $0, $0
|
||||
.byte $0, $0, $0, $0
|
||||
|
|
|
@ -4,18 +4,19 @@
|
|||
; TILES listing
|
||||
;
|
||||
; 00 - Grass
|
||||
; 02 - Inserter 1 1
|
||||
; 04 - Inserter 1 2
|
||||
; 06 - Inserter 1 3
|
||||
; 08 - Assembler1 1
|
||||
; 10 - Assembler1 2
|
||||
; 12 - Assembler1 3 ---- This is the mark between itemable tiles
|
||||
; 14 - Conveyor 1 1
|
||||
; 16 - Conveyor 1 2
|
||||
; 18 - Conveyor 1 3
|
||||
; 20 - Conveyor 2 1
|
||||
; 22 - Conveyor 2 2
|
||||
; 24 - Conveyor 2 3
|
||||
; 02 - Player
|
||||
; 04 - Inserter 1 1
|
||||
; 06 - Inserter 1 2
|
||||
; 08 - Inserter 1 3
|
||||
; 10 - Assembler1 1
|
||||
; 12 - Assembler1 2
|
||||
; 14 - Assembler1 3 ---- This is the mark between itemable tiles
|
||||
; 16 - Conveyor 1 1
|
||||
; 18 - Conveyor 1 2
|
||||
; 20 - Conveyor 1 3
|
||||
; 22 - Conveyor 2 1
|
||||
; 24 - Conveyor 2 2
|
||||
; 26 - Conveyor 2 3
|
||||
;
|
||||
;
|
||||
;
|
||||
|
|
|
@ -14,16 +14,16 @@
|
|||
|
||||
World: ; This is the array which stores all of the world data.
|
||||
; Right now this is just 10x10, so no other methods are needed.
|
||||
.byte 02, 02, 02, 02, 02, 02, 02, 20, 00, 00
|
||||
.byte 00, 08, 00, 00, 00, 00, 00, 00, 00, 00
|
||||
.byte 00, 02, 08, 02, 00, 08, 08, 08, 00, 00
|
||||
.byte 00, 00, 00, 08, 00, 00, 00, 00, 00, 00
|
||||
.byte 00, 00, 00, 00, 08, 00, 00, 00, 00, 00
|
||||
.byte 00, 00, 00, 00, 00, 08, 00, 00, 00, 00
|
||||
.byte 00, 00, 00, 00, 00, 00, 08, 00, 00, 00
|
||||
.byte 00, 00, 00, 00, 00, 00, 00, 08, 00, 00
|
||||
.byte 00, 00, 00, 00, 00, 00, 00, 00, 08, 00
|
||||
.byte 00, 00, 00, 00, 00, 00, 00, 00, 00, 08
|
||||
.byte 16, 16, 16, 16, 16, 16, 16, 10, 00, 00
|
||||
.byte 00, 00, 00, 00, 00, 00, 00, 00, 00, 00
|
||||
.byte 00, 02, 00, 02, 00, 00, 00, 00, 00, 00
|
||||
.byte 00, 00, 00, 00, 00, 00, 00, 00, 00, 00
|
||||
.byte 00, 00, 00, 00, 00, 00, 00, 00, 00, 00
|
||||
.byte 00, 00, 00, 00, 00, 00, 00, 00, 00, 00
|
||||
.byte 00, 00, 00, 00, 00, 00, 00, 00, 00, 00
|
||||
.byte 00, 00, 00, 00, 00, 00, 00, 00, 00, 00
|
||||
.byte 00, 00, 00, 00, 00, 00, 00, 00, 00, 00
|
||||
.byte 00, 00, 00, 00, 00, 00, 00, 00, 00, 00
|
||||
|
||||
ItemLoc:
|
||||
.byte 02, 00, 00, 00, 00, 00, 00, 00, 00, 00
|
||||
|
|
Loading…
Reference in New Issue
Block a user