Sprites in a maze game

Get help using Construct 2

Post » Mon Jan 27, 2014 6:53 pm

Making a maze game, and wondering about setting up the walls. I've created the layout of my maze using GIMP, saved as a PNG. When importing as a sprite is there any way i can make the walls of my imported PNG solid with out adding in extra sprites? Im cooking up some pretty intricate mazes, and i fear if i have to add extra sprites to make the walls solid, it will impact performance. Also, if this is in the wrong spot, i apologize. If you could point me in the right way i would appreciate it, Thank You!

Servontius2014-01-27 18:56:29
B
2
Posts: 2
Reputation: 204

Post » Mon Jan 27, 2014 7:02 pm

There is no way to make the walls solid from the png.

I would reccomend recreating the maze in tilemap object, that shouldn't be that hard.
Another option would be using one invisible tiledbackground of 2x2 pixels with solid behaviour to overlay the non-walkable areas.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Mon Jan 27, 2014 10:31 pm

I haven't tried this yet, but maybe you can detect the different colors of the maze. For example, if your player sprite moves on a black area (wall), then move the player back. The user would perceive this as a solid wall.

Please let us know if you find a way that works.
B
20
S
4
G
1
Posts: 185
Reputation: 2,563

Post » Wed Jan 29, 2014 7:22 am

Can do, thanks for the suggestions guys!!
B
2
Posts: 2
Reputation: 204

Post » Wed Jan 29, 2014 7:39 am

Create a tiny 2X2 px transparent tiled background and overlay all your maze walls with it, set collision detector to the new bg and Bingo!. Tiny overhead the way C2 handles tiled bg's and very simple to implement.
There are 10 types of people in the World, those that understand binary and those who don't.
B
7
S
2
Posts: 93
Reputation: 797

Post » Wed Jan 29, 2014 7:42 am

[Sorry keep losing my posts or pieces of them, my last post should have read:
"As Littlestain says above,

Create......"]
There are 10 types of people in the World, those that understand binary and those who don't.
B
7
S
2
Posts: 93
Reputation: 797

Post » Wed Jan 29, 2014 8:58 am

@Servontius - I was about to ask the very same question. Thanks for gathering the questions for me :)

I was wondering if there isn't a way to get the Alpha value on a given point on the sprite. (Something like Sprite.Alpha_At(X,Y))

Another approach may relay on the difference between the RGB values when the sprite is visible/invisible. This may be used to store the alpha data into an array and recreate the "walls" with a 1*1 sprite.(Something like RGB_At(X,Y))

Is it possible to access any of this data?
B
12
S
3
Posts: 104
Reputation: 1,655


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 26 guests