It is an object, @dale_coopThat key card is a tile or an object?
Possibly, I'm going to go through the script and see what I can find. Thank you!You might have made a modifications in one of the script that causes that.
Modifications in the handle object collision script maybe?
;;; object collions have to check from current index
;;; through the rest of the objects on the field of play.
;;; Objects prior to its index have already checked against this particular object
SwitchBank #$1C
;;STEP 1: Check for inactivity.
LDA Object_status,x
AND #%10000000
BNE +doCheckSelfForObjectCollision
;; object is inactive.
JMP +skipObjectCollisionCheck
+doCheckSelfForObjectCollision:
;;STEP 2: Check for hurt state.
;;; In this module, monsters will use action step 7 for their hurt state.
TXA
STA selfObject
STA temp
GetActionStep temp
CMP #$07
BNE +notHurt
JMP +skipObjectCollisionCheck
+notHurt
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;STEP 3: Set up bounds for self collision.
TXA
PHA
LDY Object_type,x
LDA ObjectFlags,y
STA tempA ;; temp A now holds the current object flags.
;; collision box is still held over from the physics routine.
LDA xHold_hi;Object_x_hi,x
CLC
ADC self_left
STA bounds_left
LDA xHold_hi;Object_x_hi,x
CLC
ADC self_right
STA bounds_right
LDA yHold_hi;Object_y_hi,x
CLC
ADC self_top
STA bounds_top
LDA yHold_hi;Object_y_hi,x
CLC
ADC self_bottom
STA bounds_bottom
TYA
PHA
;;; we probably want this to live inside bank 1C
;;; so that we can access flag data easily with no RAM.
;;;; Right now, in this module, it is there by default.
;;;; If it is not, we will have to bankswap to 1c here.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Check the type of object.
;;; If it is a weapon, it will check against monsters only.
LDA Object_flags,x
AND #%00000100
;DestroyObject
BNE +isWeapon
JMP +notPlayerWeapon
+isWeapon
LDX #$00
loop_objectCollision:
CPX selfObject
BNE +notSelfObject
JMP +skipCollision
+notSelfObject
LDA Object_status,x
AND #%10000000
BNE +isActive
JMP +skipCollision
+isActive:
LDA Object_flags,x
AND #%00001000
BNE isMonsterWeaponCol
JMP +notAmonsterWeaponCollision
isMonsterWeaponCol:
JSR getOtherColBox
JSR doCompareBoundingBoxes
;DestroyObject ;Destroys all objects lol
;;; if they have collided, it is a 1
;;; if not, it is a zero.
BEQ +skipCollision
TXA
STA otherObject
;; There was a collision between a monster and a weapon.
;; weapon is self.
;; monster is other.
;DestroyObject
;ChangeActionStep otherObject, #$07
JSR doHandleHurtMonster
ChangeActionStep otherObject, #$07
LDA selfObject
CMP #$0A
BEQ skipper
LDX selfObject
DestroyObject
skipper:
JMP +done
+skipCollision
+notAmonsterWeaponCollision
INX
CPX #TOTAL_MAX_OBJECTS
BEQ +lastCollisionForThisObject
JMP loop_objectCollision
+lastCollisionForThisObject
JMP +done
+notPlayerWeapon
LDA Object_flags,x
AND #%00000010
BNE +isPlayerForCol
;; not player for collions
JMP +notPlayerForCollisions
+isPlayerForCol
LDX #$00
loop_objectPlayerCollisions:
CPX selfObject
BNE +notSelfObject
JMP +skipCollision
+notSelfObject
LDA Object_status,x
AND #%10000000
BNE +isActive
JMP +skipCollision
+isActive
LDA Object_flags,x
AND #%00001000
BNE +isPlayerMonsterCol
JMP +notPlayerMonsterCollision
+isPlayerMonsterCol
JSR getOtherColBox
JSR doCompareBoundingBoxes
;;; if they have collided, it is a 1
;;; if not, it is a zero.
BNE +dontSkipCol
JMP +skipCollision
+dontSkipCol
TXA
STA otherObject
;; There was a collision between a monster and a weapon.
;; player is self.
;; monster is other.
;JMP RESET
JSR doHandleHurtPlayer
JMP +done
+notPlayerMonsterCollision:
;;;;;;; THIS IS WHERE I WANT TO ADD A CHECK FOR MONSTER WEAPON ;;;;;;;
LDA Object_flags,x
AND #%00010000
BNE +isPlayerMonsterWeaponCol
JMP +isNotPlayerMonsterWeaponCol
+isPlayerMonsterWeaponCol
JSR getOtherColBox
JSR doCompareBoundingBoxes
BNE +doCollision
JMP +skipCollision
+doCollision
TXA
STA otherObject
;; There was a collision between a player and a monster weapon.
;; player is self.
;; monster weapon is other.
DestroyObject ;; normally we destroy it because its a weapon ;;
LDX selfObject ;; 9Panzer edit ;;
JSR doHandleHurtPlayer
JMP +done
+isNotPlayerMonsterWeaponCol:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
LDA Object_flags,x
AND #%00100000
BNE +isPlayerPowerupCol
JMP +isNotPlayerPowerupCol
+isPlayerPowerupCol
JSR getOtherColBox
JSR doCompareBoundingBoxes
BNE +doCollision
JMP +skipCollision
+doCollision
TXA
STA otherObject
;; There was a collision between a player and a powerup.
;; player is self.
;; powerup is other.
DestroyObject
LDA updateScreenData
ORA #%0000100
STA updateScreenData
.include SCR_PICKUP_SCRIPTS
JMP +done
+isNotPlayerPowerupCol
LDA Object_flags,x
AND #%10000000
BNE +isPlayerNPCCol
JMP +isNotPlayerNPCCol
+isPlayerNPCCol
JSR getOtherColBox
JSR doCompareBoundingBoxes
BEQ +skipCollision
TXA
STA otherObject
;; There was a collision between a player and a powerup.
;; player is self.
;; powerup is other.
TXA
PHA
LDX selfObject
LDA xPrev
STA Object_x_hi,x
STA xHold_hi
LDA yPrev
STA Object_y_hi,x
STA yHold_hi
LDA #$00
STA Object_h_speed_lo,x
STA Object_h_speed_hi,x
STA Object_v_speed_lo,x
STA Object_v_speed_hi,x
STA Object_x_lo,x
STA Object_y_lo,x
PLA
TAX
JMP +done
+isNotPlayerNPCCol
+skipCollision
INX
CPX #TOTAL_MAX_OBJECTS
BEQ +lastCollisionForThisObject
;JSR doWaitFrame
JMP loop_objectPlayerCollisions
+lastCollisionForThisObject
; PLA
; TAX
JMP +done
;; Add other object to object collision types here.
JMP +done
+notPlayerForCollisions
+done
;DestroyObject
PLA
TAY
PLA
TAX
+skipObjectCollisionCheck
ReturnBank
LDA selfObject
CMP #$0A
BEQ skipper
LDX selfObject
DestroyObject
skipper:
LDX selfObject
LDA Object_type,x
CMP #$0A
BEQ skipper
DestroyObject
skipper:
I mean could have also been flagged "monster weapon", to hurt your player while you use it@dale_coop Yes, the flamethrower is indeed flagged as a "player weapon".
;;; Check if the B-button is pressed
LDA gamepad
AND #%00000001 ;A-button
BNE +
RTS ;;; If the B-button is not pressed we exit the script.
+
LDA myFlame_10
CMP #$01
BCS work2
LDA myFlame
CMP #0
BNE work2
JMP canNotShoot111
work2:
CountObjects #%00000100
CMP #1
BNE shooter
JMP canNotShoot111
shooter:
SubtractValue #$01, myFlame, #$01, #$00
UpdateHudElement #$06
TXA
PHA
TYA
PHA
LDX player1_object
LDA Object_x_hi,x
CLC
ADC #$04
STA tempA
LDA Object_y_hi,x
CLC
ADC #$04
STA tempB
LDA Object_direction,x
AND #%00000111
STA tempC
PlaySound #sfx_magicCast
CreateObject tempA, tempB, #$04, #$00
LDA tempC
STA Object_direction,x
TAY
LDA DirectionTableOrdered,y
STA temp1
TXA
STA temp
StartMoving temp, temp1
PLA
TAY
PLA
TAX
canNotShoot111:
I don't think it's that 2 button code.I wonder if it is baard's two button input code that is causing to get corrupted somehow???
StopMoving temp, #$FF, #$00
CPX player1_object
BNE +continueP
StopMoving temp, #$FF, #$00
+continueP: