Make a tile disappear or become transparent?

Akiak

  • Posts: 29
So what I want to do here is when the player clicks on certain tiles with the mouse, they disappear (or become transparent/non-solid).

Is this possible with tiles or do I need to use actors?

thegenericbanana

  • *
  • Posts: 494
So what I want to do here is when the player clicks on certain tiles with the mouse, they disappear (or become transparent/non-solid).

Is this possible with tiles or do I need to use actors?
I'm pretty sure you need to use actors, like you can't program tiles. It shouldn't be too hard with actors, though-Put the actor tiles collision the same as tiles (Colliding with everything except Tiles), and have them be unaffected by gravity and can't be pushed. Inanimate, really.
Then, you can just make it so if it's clicked, it kills itself.

What are you making, a building/destroying game like Terraria or Minecraft? :P
Johnny Turbo's Surgery Frenzy

Akiak

  • Posts: 29
Nah, it's actually a completely new take on platforming in general. I'll release more information once I've done some progress. 8)

Anyway the problem is that if I use actors, I'll need to fill up the whole stage with them, which might make it lag a bit.

coleislazy

  • *
  • Posts: 2607
You can add and remove tiles at runtime via code, but the collision boxes will not be updated. If thats no problem, check out this article: http://www.stencyl.com/help/viewArticle/47

thegenericbanana

  • *
  • Posts: 494
It wouldn't lag as much if you put the actor as inanimate in it's physics tab, and had the behavior attached. You should try it, it takes a couple of minutes to try. If there's lag, you can try a code approach.
Johnny Turbo's Surgery Frenzy

Akiak

  • Posts: 29
Okay I've done it with actors, made them inanimate and it works like a charm, but it is a bit slow.

I have absolutely no experience with coding and if there's some other solution out there to reduce lag I'd greatly appreciate it.

rob1221

  • *
  • Posts: 9472
Maybe there are some changes you can make to your behaviors to reduce lag.  Can you post the behaviors related to the actors you want to click on?

Akiak

  • Posts: 29
I'll give some more detail. What I want to do is fill up the scene with these tile actors so that when you click on one it switches from solid to transparent:

"Block" has both the solid animation and the transparent one, and the solid one is the default.
"Copy of Block" has both animations too, except the default is the transparent one.

This is the behavior I attached to both:

The "Animation" attribute is the solid one, while "Blank" is the transparent one.

I filled up the whole stage with these tiles and it works perfectly, except for the lag.

rob1221

  • *
  • Posts: 9472
Hmm I don't see anything wrong there.  The only other thing I can think of is restricting physics as much as possible.

C1poplar

  • Posts: 1
Has anyone found a solution for this problem as I am requiring the use of a transparent tile within my next Stencyl project. 

Rgds

Adam