All Pickups lock issue

LOGCTERA

New member
Hi there, again...
I've set all pickups lock to one of my assets and set a couple of gems that you need to pickup in order to open the door, but either way, my character can go straight through the pickup lock block. I've been following Joe's tutorial on making a simple platform game (Pi Beta) for this. How do I fix this?
Sorry for bothering for the millionth :lol: time...!
Any replies would be kindly appreciated!
 

MistSonata

Moderator
Chances are, there's something in the 4.0 code that changed from the pi beta. Your best bet is probably to just wait until the adventure module releases later this week and follow the tutorial for that.
 

dale_coop

Moderator
Staff member
Found out that now, the pickup/collectable objects are managed by the Power Up game objects : "Health Pickup", "Charge Pickup", "Key Pickup" and 'Currency Pickup".
For each of them, you can assign a script (in "Basic Settings > Scripts settings") "Power Up 00" --> "Power Up 03"
When you collect one pickup, the associated code is executed.

Currently, in the "Routines\UserScripts\BasicScripts\PowerUpCode\" folder there are just 3 script (one doing nothing, one increasing the health and one increasing the score).
So, you could add yours for key/lock, for example "PowerUp_UnlockDoors.asm", with:
Code:
;; code that trigger the screen/unlock the doors
  JSR countAllTargets

And then assign that script to "Power Up 02" type (corresponding to the "Key Pickup" game object) in the "Scripts settings".
VoilĂ , you take the "Key" the doors are disapear (like in the pi tutorials).

The only "problem" I have with that, is the palette... you can only use the player palette for your PickUps
 
Top Bottom