[Byte-Off 2020] The Box

Craigery

Active member
uc


Craig's Warehouse of 50ft. Toupees Presents...
T H E B O X


----Title----
THE BOX

----Gameplay----
Stealth, Corporate Espionage

----Tagline----
This Box Delivers!

----Synopsis----
In the far off future of 199Z information is the new currency, To collect this currency one must commit the sexiest of all the white collar crimes...
Corporate espionage!! There is only one man who has the brains, the will, and the postage to pull off such daring heists. The total package...
T H E B O X
Take control of THE BOX and infiltrate the offices of major packing and shipping corporate titans.
Sneak down endless corridors. Avoid security. Hack into their computer systems. Get paid.

uc

uc

uc


Still VERY much a WIP, but I have been working very hard on THE BOX. It is a side scrolling stealth game where you avoid security guards by hiding next to other boxes to blend in. You go into computer rooms and hack computers, then get to the exit. There are few box or shipping related puns in there too. I think that I have most of the art and level layouts complete, but coding is not going quite as smooth. Thankfully I took next week off so I can really concentrate on it and ask for assistance. I hope to show off some gameplay video once I have a few more things going code wise (player death, monster projectile, and proximity)
 

mouse spirit

Well-known member
Solid Snake ain't got nothin' on Lex Luger! Sorry that was the first thing that
came to mind when seeing all of this and reading total package.
 

Craigery

Active member
I have been working a lot of hours trying to wrap this up before the deadline, but I got a lot of hours left to put in on this project. So here are some animations and I will be asking for some help in my next post.

First off here is the Death animation.
uc


Some hiding! All part and parcel of the job.
uc


I really hope I can be done in time!
 

Craigery

Active member
UPDATE 9/13/2020
I think I have both of these bugs fixed now!
Yay me!


------BUGS I NEED HELP WITH-------

1. My player death plays inconsistently. Some screens it plays fine, others it doesn't play. It for sure plays fine on screen 0x0 not sure why that is. I have copied this screen to another screen and it doesn't play the death animation. Death is caused by Monster Weapon object that is transparent.
uc


Here is my doHandleHurtPlayer.asm
Code:
		LDX player1_object
		LDA Object_x_hi,x
		STA tempA
		LDA Object_y_hi,x
		STA tempB
        LDX Object_screen
        LDA Object_screen,x
        STA tempC
		
	;Death
	CreateObjectOnScreen tempA, tempB, #$0A, #$00, tempC

	;Legs
	LDA tempA
	ADC #$10
	STA tempA
	LDA tempB
	ADC #$18
	STA tempB
	CreateObjectOnScreen tempA, tempB, #$0B, #$00, tempC
	
	LDX player1_object
	DestroyObject

It saves the player position, destroys it, then creates 2 objects, the main death animation and then the legs as a separate object. So I think something else is interfering with this, but I am not sure where to start looking.


2a. I am working with (what is essentially) the Brawler mod script WaitForXproximity.asm. I would like to have my monster only check Proximity in the direction it is facing. The code currently gets the players position, then compares it with the monster and if it is within so many pixels then ChangeActionStep. But I need to add something so it based on direction. How does this sound? Do i need to rethink this?

Code:
LDA Object_direction,x 
if its Left go compare the players x (tempA) to Object_x_hi,x
If it is less than then doProxyThing
otherwise +skip

but if check Object_direction,x is Right
if its Left go compare the players x (tempA) to Object_x_hi,x
If it is greater than then doProxyThing
otherwise +skip

I can't quite wrap my brain around the logic yet. I need more sleep.


2b. I am also trying to skip the Proximity when Object_vulnerability bit 6 is checked.
Code:
	LDX player1_object
	LDA Object_vulnerability,x
	AND #%00000100
	BEQ +skip
	JMP doProxyXCheck

doProxyXCheck:

;;; this behavior will wait until there is proximity between the object and the player in the x position,
;;; and then jump to the next behavior when the condition is true.

	TXA
	PHA
		LDX player1_object
		LDA Object_x_hi,x
		STA tempA
		LDA Object_screen,x
		STA tempB

	PLA
	TAX
	
	LDA tempB
	CMP Object_screen,x
	BNE +skip
	
	LDA tempA
	SEC
	SBC Object_x_hi,x
	BCS +distIsPos
		;; dist is neg
		EOR #$FF
		ADC #$01
	+distIsPos
		CMP #$64
		BCC +updateActionStep
		JMP +skip
	+updateActionStep:
		;; jump to next action state.
		TXA
		STA temp
		;GetActionStep temp
		;CLC
		;ADC #$01
		;AND #%00000111
		;STA temp1
		ChangeActionStep temp, #$06
	+skip

And here is my player details and what Bit i have checked
uc



This is pretty much the Brawler WaitForXproximity.asm, but I added a check Object_vulnerability at the beginning. However, checking the Object_vulnerability doesn't appear to be working. My player action steps 02 and 03 have Object_vulnerability bit 6 on the PLAYER is checked. My monster action step has the Proximity script set on repeat, which works as intended. The Object_vulnerability part at the beginning won't trigger the proxy code and won't allow me to activate the player animations that are checked as bit 6.

Any help is appreciated! Thanks
 

AllDarnDavey

Active member
Craigery said:
This is pretty much the Brawler WaitForXproximity.asm, but I added a check Object_vulnerability at the beginning. However, checking the Object_vulnerability doesn't appear to be working. My player action steps 02 and 03 have Object_vulnerability bit 5 on the PLAYER is checked. My monster action step has the Proximity script set on repeat, which works as intended. The Object_vulnerability part at the beginning won't trigger the proxy code and won't allow me to activate the player animations that are checked as bit 5.

Any help is appreciated! Thanks
EDIT:
Start from the right when checking Object_vulnerability, #%00100000 is what you need to check NOT #%00000100
 

AllDarnDavey

Active member
Craigery said:
2a. I am working with (what is essentially) the Brawler mod script WaitForXproximity.asm. I would like to have my monster only check Proximity in the direction it is facing. The code currently gets the players position, then compares it with the monster and if it is within so many pixels then ChangeActionStep. But I need to add something so it based on direction. How does this sound? Do i need to rethink this?

Code:
LDA Object_direction,x 
if its Left go compare the players x (tempA) to Object_x_hi,x
If it is less than then doProxyThing
otherwise +skip

but if check Object_direction,x is Right
if its Left go compare the players x (tempA) to Object_x_hi,x
If it is greater than then doProxyThing
otherwise +skip

I can't quite wrap my brain around the logic yet. I need more sleep.

You are on the right track... here's some pseudo code
Code:
LDA Object_direction,x  ;;get enemy facing direction
AND #%00000010  ;;clear all bits but the right check
CMP #%00000010  ;;compare to a right facing byte
BEQ enemyFaceRight
     ;; proximity check facing left
     ;; player x, hi
     ;; minus enemy x, hi
     ;; is less then proximity?
     ;; JMP withinProximity
     ;; else JMP NotWithinProximity
enemyFaceRight:
     ;; proximity check facing right
     ;; enemy x, hi
     ;; minus player x, hi
     ;; is less then proximity?
     ;; JMP withinProximity
     ;; else JMP NotWithinProximity     
withinProximity:
;;proximity hit code
 
NotWithinProximity:
     RTS     ;; do nothing, end subroutine
 

Craigery

Active member
AllDarnDavey said:
Your Object_vulnerability is wrong, you need to check the 5th bit, not if it equals 5. #%00000100 = the number 5, #%00010000 = 5th bit.
EDIT:
Also judging from your pic, you need to check the 6th bit... AND #%00100000

Looks like I did mean 6 and I edited my original post to reflect that. So when I do that it won't let me finish my hiding action, it resets to action step 0 with each repeat of the code, if I put it on loop it only resets the duration of the timer. So something is causing it to reset, but I guess I am not sure where yet.


AllDarnDavey said:
You are on the right track... here's some pseudo code
Code:
LDA Object_direction,x  ;;get enemy facing direction
AND #%00000010  ;;clear all bits but the right check
CMP #%00000010  ;;compare to a right facing byte
BEQ enemyFaceRight
     ;; proximity check facing left
     ;; player x, hi
     ;; minus enemy x, hi
     ;; is less then proximity?
     ;; JMP withinProximity
     ;; else JMP NotWithinProximity
enemyFaceRight:
     ;; proximity check facing right
     ;; enemy x, hi
     ;; minus player x, hi
     ;; is less then proximity?
     ;; JMP withinProximity
     ;; else JMP NotWithinProximity     
withinProximity:
;;proximity hit code
 
NotWithinProximity:
     RTS     ;; do nothing, end subroutine

This looks like it will be some help. After my kid goes to sleep I will dive back in! Thanks, AllDarnDavey.
 
Top Bottom