TOUR
PRICING
HELP
Stencylpedia
Blocks Guide
Sample Games
Developer Center
FORUMS
CHAT
#MADEINSTENCYL
EDUCATION
SIGN IN
×
Welcome back!
Username or E-mail
Password
(
Forgot?
)
C
OMMUNITY
Home
Issue Tracker
Inbox [0]
New Posts
New Replies
Search
Stencyl Community
→
Stencyl
→
Ask a Question
→
Can be detected if a player is inside a tile
Pages:
1
Can be detected if a player is inside a tile
Apamaster
Posts: 129
February 01, 2020, 11:42:02 am
My idea is to detect if a player is inside a tile that has no collision. I know that behaviors in the world exist on tiles, but I only saw an example in the forum.
The idea is to use a tile without collision as a region if the character enters the tile something happens.
of the tileset tile 1A no collision template:
Example the player is inside tile 1A or step, if so then player dies.
JeffreyDriver
Posts: 2262
February 01, 2020, 02:34:21 pm
Yes, you can check if a tile exists at a certain XY location. SCENES > WORLD > TILES
You'll need to convert the XY value to a row/column value but there are the blocks for that.
Current Projects:
The Grand Grimoire Chronicles Episode 3
Twitter@JeffreyDriver
apps.jeffreydriver.co.uk
Apamaster
Posts: 129
February 01, 2020, 05:55:59 pm
but I do not understand how to use it, I put 1 1 which would be the first frame that has a tile but only returns -1, and in the section anything I should put?
this gives error when I compile I put in the coordinates 0 0 create a block in layer 0 and I suppose that from tile set id must go 1 which is the only tile I have.
« Last Edit: February 01, 2020, 06:17:29 pm by Apamaster »
Luyren
Posts: 2810
February 02, 2020, 04:39:02 am
Quote from: Apamaster on February 01, 2020, 11:42:02 am
My idea is to detect if a player is inside a tile that has no collision.
The block JeffreyDriver mentioned checks if a collision of a tile exists at the given collumn/row. A tile without collision cannot be used for what you are describing. Use an actor with a sensor collision instead if you plan to go with that idea.
If you do need more info on the blocks for tiles, read here:
http://www.stencyl.com/help/view/tile-api
My Stencyl resources are available here:
https://luyren.itch.io/
Cutscenes, RPG Elements, Particles, Map System and many more.
Apamaster
Posts: 129
February 02, 2020, 12:08:07 pm
I already solved the problem, I already understood how it works although there are more examples of api uses.
ichimitch
Posts: 73
February 03, 2020, 03:27:22 am
I'd place an sensor-actor which uses the "hide sprite" block in a when created event (rather than an actor which looks like a tile). That way you can reuse it along side any other tile.
Pages:
1