Game editor has no control variable for zdepth, which means you can not "getActorZdepth".
However, you can create one global variable (e.g
double player_zdepth
;) and set player´s zdepth constantly to a specific value using
ChangeZDepth("player", (player_zdepth
= 0.000000));On that way you will keep track of the player´s zdepth using a variable.
________________________________________________________________________________________________________________________________________________
You said you have the image of your walls?
I have good news for you. The major project I am working on can load the entire image in runtime in buffer and you use a function to get color at x/y.
Unfortunately loading x32 bit PNGs (those with alpha channels) is a feature that will be supported in the next version of it.
On the other hand, black is a 0.0.0 color and even with alpha chanel, it will be easy to determine it, hence in that case, alpha will be simply ignored.
So you can pretty much convert your image to a bmp and this will work as long as you don´t want to return the actual transparent color, but simply if it is black or not.
________________________________________________________________________________________________________________________________________________
Yes, you can turn off collision:
EventDisable("player", EVENTCOLLISION
);or/and
EventDisable("Event Actor", EVENTCOLLISIONFINISH
);and their Enable analogue.
________________________________________________________________________________________________________________________________________________
Using my project a raw code would be like:
- Code: Select all
int player_touches_color;
int black_color = 0;
DWORD bgHeight = bitfox_get_height_data(BMPDATA[WALLS]);
RGB trio = bitfox_getcolor_xy_data(BMPDATA[WALLS], player.xscreen, bgHeight - player.yscreen);
((unsigned char*)&player_touches_color)[0] = trio.R;
((unsigned char*)&player_touches_color)[1] = trio.G;
((unsigned char*)&player_touches_color)[2] = trio.B;
if(player_touches_color == black_color)
EventDisable("player", EVENTCOLLISION);
else
EventEnable("player", EVENTCOLLISION);
Of course, there will be much more elegant way to do so.. this is just a raw view of how it works. This will stop doing any collision effect if player is in touch with black.
You can play with the condition and make it dependable of the zdepth as I exemplified above. I am giving you a view of one possible way. If you want this code to work you will have to wait for the project release, which is going to be soon anyway.