Can't go through invisible parts of a PNG?
justinodunn
Member, PRO Posts: 226
in Tech Support
I have one png file which are the walls of the game, and on 4 sides there are rectangle shapes to resemble walls in the PNG file, however nothing is in the middle. I made it so when main actor collides with wall (the png), but when the main actor walks into the PNG, even in the middle (empty part), it still collides with the PNG?
Comments
I believe what your asking is 'pixel collision' which isn't supported here. We have 2 options. square or circle. So a circle would effectively allow your corners to avoid collision.
@justinodunn, cut the png into seperate strips, so that each section or side can be placed on individual actors. Benefit is also that you can reuse those walls for different level designs.
MESSAGING, X-PLATFORM LEADERBOARDS, OFFLINE-TIMER, ANALYTICS and BACK-END CONTROL for your GameSalad projects
www.APPFORMATIVE.com
That could work, but what if my walls are curved/ has ups and downs on each side?
Forget colliding with that art. instead create an actor that is used for collisions. Change its alpha to 0 at runtime. Then just overlay it on your scene wherever you need collision.
@justinodunn, if your level layout is very intricate with smooth curves, etc, you can go with your first approach of making one big background actor with the image in which has no collision rules. Then make 1 seperate wall actor with alpha 0 which will act as your collider and repeate this actor appropriately on the scene .
MESSAGING, X-PLATFORM LEADERBOARDS, OFFLINE-TIMER, ANALYTICS and BACK-END CONTROL for your GameSalad projects
www.APPFORMATIVE.com
Good idea! However how do you think it will work if I were to make an endless runner? So the spawned walls are random. Will I need to collaborate with tables?
Sure, use tables to define the background image and corresponding collision actor placement.
I would break the level up into predefined sections, then randomly choose the sequence during gameplay.
Just make the ends of each section be able to match up to any othe section.
MESSAGING, X-PLATFORM LEADERBOARDS, OFFLINE-TIMER, ANALYTICS and BACK-END CONTROL for your GameSalad projects
www.APPFORMATIVE.com
Alright thanks!
Do you have any ideas how though? I'm struggling a bit