THE HUNS: LEVEL 1 COMPLETE ---- 03-13

A place where you can keep others updated about your NES-related projects through screenshots, videos or information in general.

Moderator: Moderators

v.depatie
Posts: 235
Joined: Sun Nov 03, 2024 4:01 pm
Contact:

THE HUNS: LEVEL 1 COMPLETE --- 03 13 update

Post by v.depatie »

Okay ! I've been working hard the last 16 hours to upload this ! MAN almost one million chars of ASM, about 20k lines. Of course there is alot of places to optimize, I'm just getting started with jump tables :D . BUT, The game engine is mostly ready, I can just draw for now, add textboxes when I want, add current ennemies. Still got about 150KB avail.= for levels and other item upgrades and more dmc sounds!!!!!!
unti.png
unti.png (1.79 KiB) Viewed 520 times

cart - LEVEL 1 COMPLETE !.nes
(256.02 KiB) Downloaded 13 times


LEVEL 1 is complete !


We're you able to complete? to get to the door? To kill the bird? The zombie? Did you cut some grass? Break the rock ?



I need feedback :D :beer: :D :P


(-missing a dmc sound effect for the pound ? not sure yet. I do have one on rock hits)
(-no damage yet on the player)
(-if killed without dying, zombie might give a sword boost to p1 randomely, bird also )
(-missing the teleport to LEVEL 2)
unti2.png
v.depatie
Posts: 235
Joined: Sun Nov 03, 2024 4:01 pm
Contact:

Re: THE HUNS: LEVEL 1 COMPLETE ---- 03-13

Post by v.depatie »

Little fix to the textbox, this is the latest version . I started to draw the level 2. Working on that tonight .

Also here is some gameplay for those who dont have time or can't or w/e

https://www.youtube.com/watch?v=0WmsMCq ... e=youtu.be

here is my live channel, I will be programming live the rest of the game.

https://youtube.com/live/P-Zfp0E-MTw

Here is the latest version with the textbox fix and a new DMC sound effect for the pound!!!!
unti2.png
Attachments
Untitled.png
User avatar
Anna_TeamRocket
Posts: 31
Joined: Sat Jan 04, 2025 3:21 am

Re: THE HUNS: LEVEL 1 COMPLETE --- 03 13 update

Post by Anna_TeamRocket »

v.depatie wrote: Wed Mar 12, 2025 11:01 pm Okay ! I've been working hard the last 16 hours to upload this ! MAN almost one million chars of ASM, about 20k lines.
My template only has a few running lines of code and I still believe they're very wasteful. For example:

Code: Select all

INFLOOP:		;every JMP sets PC (program counter)
	LDA $01
	BNE READINPUT1	;one input per frame
	JMP INFLOOP	;wait for NMI
		
READINPUT1:			
	LDA #$01
	STA $4016	;write 1 then 0 bit to 4016, then pull it out one bit at a time
	LSR		;LSR=1 byte, LDA=2 byte
	STA $4016	;4016 player 1, 4017 player 2
	LDX #$08	;start the cycle
READINPUT2:	
	ASL $02			;free the rightmost bit
	LDA $4016
	AND #$03		;A=A*0000 0011 (to pure it out)
	ORA $02			;A=A+$02
	STA $02			;$02=A
	DEX
	BNE READINPUT2	;Z=1 go down
	LDA #$00
	STA $01
	
	JSR PLAYER1CONTROL
	JSR PLAYER1OUTPUT
	JMP INFLOOP
	
PLAYER1OUTPUT:
	LDA $10		;Y coordinate
	CPX #28		;left move frame #2
	BEQ :+
	CPX #08		;right move frame #2
	BEQ :+
	CLC
	SBC #$00
:	STA $0210	;Upper half Y
	STA $0214
	CLC
	ADC #$08
	STA $0218	;Lower half Y
	STA $021C	
	LDA $11		;X coordinate
	STA $0213	;Left half X
	STA $021B
	ADC #$08
	STA $0217	;Right half X		
	STA $021F
	LDY #$00
:	LDA PLAYER_SPRITE_TILES, X
	STA $0211, Y	;Player 1, sprite tiles
	LDA $12						
	STA $0212, Y	;Player 1, sprite attributes
	INX
	INY
	INY
	INY
	INY
	CPY #$10
	BNE :-
	RTS

PLAYER1CONTROL:	;ABCD^v<>
	LDA $03
	BEQ :+		;if Z=1 go down
	JMP PLAYER1FIRE2
:	LDA $02		;read player 1 input
	TAX
	AND #%01000000
	BNE :++		;if Z=1 go down
	TXA
	AND #%00000011	;if (Right OR Left)
	BEQ :+++			;if Z=0 go down
	LSR 		
	BNE :+			;if Z=1 go down
	JMP PLAYER1RIGHT
:	JMP PLAYER1LEFT
:	JMP PLAYER1FIRE1
:	JMP PLAYER1IDLE
	
PLAYER1IDLE:
	LDA #$00
	STA $13		;animation frames
	LDA $12		;character sprite attributes
	AND #%01000000	;#$40 = flip horizontal
	BNE :+ 		;if Z=1 go down
	LDX #0		;right idle
	RTS
:	LDX #20		;left idle
	RTS
PLAYER1RIGHT:	
	INC $13		;frame timer virtual register
	LDA $12
	AND #%00000011
	STA $12		;sprite direction attribute
	INC $11		;Player X++
	LDA $13		
	CMP #8
	BPL :+		;if N=0 go down
	LDX #4		;right move rifle frame 1
	RTS
:	CMP #16	
	BPL :+
	LDX #8		;right move rifle frame 2
	RTS
:	CMP #24	
	BPL :+
	LDX #12		;right move rifle frame 3
	RTS
:	CMP #32	
	BPL :+
	LDX #16		;right move rifle frame 4
	RTS
:	LDA #$FF	;null frame
	STA $13
	LDX #4
	RTS
PLAYER1LEFT:
	INC $13		;animation frame virtual register
	LDA $12
	ORA #%01000000
	STA $12
	DEC $11		;Player X--
	LDA $13		;animation frames
	CMP #$08
	BPL :+		;if N=0 go down
	LDX #24		
	RTS
:	CMP #$10	
	BPL :+
	LDX #28		
	RTS
:	CMP #$18	
	BPL :+
	LDX #32		
	RTS
:	CMP #$20	
	BPL :+
	LDX #36		
	RTS
:	LDA #$FF	;null frame
	STA $13
	LDX #24
	RTS
PLAYER1FIRE1:	;animation has to be locked until the first or second shot is complete
	INC $03		;lock animation
	LDA #$FF
	STA $13		;animation frame virtual register
PLAYER1FIRE2:
	INC $13
	LDA $12		;character sprite attributes
	AND #%01000000	;#$40 = flip horizontal
	BNE :+++ 	;if Z=1 go down
	;RIGHT
	LDA $13		;animation frames
	CMP #5
	BPL :+		;if N=0 go down
	JSR PLAYER1FIRE
	LDX #0		;right idle
	RTS
:	CMP #10
	BPL :+
	LDA #$FF	;disable sprite by invalid Y
	STA $020C
	LDX #40		;right shoot
	RTS
:	LDX #0		;right idle
	LDA #$FF	;disable sprite by invalid Y
	STA $020C
	LDA #0
	STA $13
	STA $03
	RTS
	;LEFT
:	LDA $13		;animation frames
	CMP #5
	BPL :+		;if N=0 go down
	JSR PLAYER1FIRE
	LDX #20		;left idle
	RTS
:	CMP #10
	BPL :+
	LDA #$FF	;disable sprite by invalid Y
	STA $020C
	LDX #44		;left shoot
	RTS
:	LDX #20		;left idle
	LDA #$FF	;disable sprite by invalid Y
	STA $020C
	LDA #0
	STA $13
	STA $03
	RTS
	
PLAYER1FIRE:
	TAX
	LDA $10		;player Y
	CLC
	ADC #3
	STA $020C	;sprite Y, fire
	LDA #$1E
	STA $020C+1	;sprite tile
	LDA $12
	STA $020C+2	;sprite attribute
	AND #$40	
	BNE :+		
	LDA $11		;RIGHT
	CLC
	ADC #$10
	STA $020C+3
	TXA
	RTS
:	LDA $11		;LEFT
	CLC
	SBC #$07
	STA $020C+3
	TXA
	RTS
	
NMI:			;PPU says graphics are done and orders to finish it up whatever you're currently doing
	LDA #$02	;load sprite range
	STA $4014	
	LDA #$01
	STA $01		;frame complete = true
	RTI		;return back from interrupt, directed by x2-byte address in Stack Memory (usually closer to 01FF-0100)
	
PLAYER_SPRITE_TILES:			;Player character metasprite
	.byte $10, $11, $12, $13	;frame 1	Facing right, Idle, Rifle	#0
	.byte $10, $11, $14, $15	;frame 2	Facing right, Move, Rifle
	.byte $10, $11, $16, $17	;frame 3
	.byte $10, $11, $18, $19	;frame 4
	.byte $10, $11, $1A, $1B	;frame 5
	.byte $11, $10, $13, $12	;frame 6	Facing left, Idle, Rifle	#20
	.byte $11, $10, $15, $14	;frame 7	Facing left, Move, Rifle
	.byte $11, $10, $17, $16	;frame 8
	.byte $11, $10, $19, $18	;frame 9
	.byte $11, $10, $1B, $1A	;frame 10
	.byte $10, $11, $1C, $1D	;frame 11	Facing right, Fire, Rifle	#40
	.byte $11, $10, $1D, $1C	;frame 12	Facing left, Fire, Rifle	#44	
Attachments
cart.s
(7.77 KiB) Downloaded 4 times
v.depatie
Posts: 235
Joined: Sun Nov 03, 2024 4:01 pm
Contact:

Re: THE HUNS: LEVEL 1 COMPLETE ---- 03-13

Post by v.depatie »

niceeeee
Post Reply