Kasumi said:
Glad it worked, at least. It wasn't exactly tested
It seems to deactivate in the video, so is there another case where it doesn't work? Edit: Oh. The beginning where it's "on" but you have full health. I could maybe help with that too. How's it currently done?
I like the fact that it starts counting up from 0 HP during player spawn too, it's a neat little effect. (i will have to test if it happens on every room or just death/start, if that's the case, it will have to be poked at.)
as for the platforms, they look like they work perfectly on the video, but there are multiple issues i have with them. Prepare yourself for this is gonna be a long post
The health platform itself is a custom tile type. the problem with this is that it's made out of 3 separate tile graphics, and each is set to tiletype 06 (health platform tile) this leads to the issue that each of the 3 tiles acts as it's own platform.
in the video i solved this by only using the middle piece as a health platform and leaving the edge pieces as normal solid. But this causes issues with collision, as you can only trigger it by standing in a specific spot on the platform.
the second issue is that i dont know how to identify the health cross object as an object (like when you do LDX player1_object to do things to the player.) the DeactivateCurrentObject im using to make the health item dissappear, requires you to load the object before deactivating it, and currently im doing this by using #$01 (because i dont know how to load the object itself, i load it from a position i know where it is at (just set it as object 1 in screen editor.))
the current code i have for the health tile is this:
Code:
LDA #TILE_SOLID
STA tile_solidity
CPX player1_object
BEQ areYouAPlayer
JMP dontActivateHealthPlatform
areYouAPlayer:
LDA tileCollisionFlag
BEQ +
JMP dontActivateHealthPlatform
+
LDA gamepad
AND #%00100000
BNE ++
JMP dontActivateHealthPlatform
++
LDX player1_object
LDA Object_health,x
CMP #$08
BNE skipeverything
RTS
skipeverything:
LDA #$01
STA tileCollisionFlag
;ChangeTileAtCollision #$01, #$62
; #$01 is the health cross, always place it as "Monster 1" on screen !!!!
; TO-DO: Figure a better way to do this.
LDX #$01
DeactivateCurrentObject
JMP DoTheHealthThing
dontActivateHealthPlatform:
RTS
DoTheHealthThing:
LDX player1_object
LDA Object_health,x
CMP #$08
BEQ skipGettingHealth2
LDA #$08
STA Object_health,x
skipGettingHealth2:
RTS
I could even live with always having the cross there if all else fails , but the collision issue with it is sort of a problem.
another problem with it is that because my code sets a tile collision flag to tiletype 06, it will deactivate ALL the health platforms.
so what im working on solving here for the moment is how to identify in which room i am, and deal with the platforms based on that, (my game will have 5 or 6 levels, and each level has a maximum of 2 of these, some propbly only one) so setting a variable for each of them is not a big deal. I just cant seem to put into code what i want here.
TL;DR:
the global deactivation is an issue.
the health cross respawning / deactivating is an issue.
the collision is an issue.
another TL;RD:
how they're made is that the platform does the healing, and it's just a tiletype.
the animated cross is object #$04 (health pickup)
the way i intended them to work is that an unused platform has the cross, indicating that it's unused. pressing down on the platform triggers it (heals you and makes the cross dissappear) and the whole point is that they stay in used state once used (need to make the cross not respawn.) the fact that their functionaily doesnt respawn at the moment is nice, the problem is that if you have 2 in a stage, they both die when you use the first one lol.
Akin to Shatterhand, where im drawing mechanics from, the idea is to make using the platform cost, but since i havent implemented money yet, they currently work just by ducking on them