1 sprite, multiple things

teamtoast

  • Posts: 7
I'm making a small game and there are dungeons with locked doors. however there are multiple doors and I'm not sure how to limit it to 1 sprite.
if someone could help me with this that would be amazing. thanks

Bombini

  • *
  • Posts: 1400
Hi,
I am not sure if i understand.
Do you want to know how to handle multiple locked doors with one door actor?
Also, how do you want to unlock those doors?
Cheers

« Last Edit: October 22, 2018, 02:58:24 am by Bombini »

CmdrWhitey13

  • Posts: 505

« Last Edit: October 22, 2018, 04:37:59 am by CmdrWhitey13 »

JeffreyDriver

  • Posts: 2262
You need some way of identifying each door. If you have a behaviour attached to your actor, you can use a local attribute to give it a unique identifying that you can customise in the 'Inspector' tab in scene view.

teamtoast

  • Posts: 7
hey, so for question 1, yes and 2 you'll find a key.

Adder

  • Posts: 37
Answer 1: Put events for doors into a behaviour and attach it to the actor type door. This will automatically recognize each door as a separate actor whilst keeping it as one actor type (although to be honest I don't see why there's an issue with just using each door without having a behaviour linked in the first place, because each one is defined as itself, and not a group)

Answer 2: Create different attributes for the different keys and set them all to false at the start. When you collect a key- let's say Red Key for example- set that key attribute to true.
Example:
[If redkey=true]
set door w/ attribute "red" to openable

Hope this helped.
Hiss hiss