Items & Enemies

Hubz

  • Posts: 7
Hi,

I'm working on porting a game I almost finished in Game Maker to Stencyl. Basically what I'm trying to figure out how to do is this -

I have 3 items, and each item can destroy a certain type of enemy. You can only hold one item at a time though. I am unsure how to do this, is there any sort or pre-made resource that could help me with this? I'm having a hard time understanding how collisions work in Stencyl and having global variables to be used.

Thanks,

- Hubz
- Hubz

Luyren

  • *
  • Posts: 2584
There's a behavior on Forge called "Inventory". It has custom blocks for adding/removing items, and you can also limite the amount of an item that the actor can carry.

EDIT: Now that I re-read your post, the behavior doesn't have built-in options to only hold one type of item at all times, but you can roll your own logic based on what you need.

« Last Edit: June 11, 2011, 07:33:00 pm by Luyren »
My Stencyl resources are available here: https://luyren.itch.io/
Cutscenes, RPG Elements, Particles, Map System and many more.
Twitter

Hubz

  • Posts: 7
Hahaha as usual I think I figured it out shortly after I asked... doh! I found out about custom attributes and am playing with that now. Think I have it somewhat going. I should be able to figure out the rest hopefully. Thanks!
- Hubz