Page 1 of 1

How to show an actor on only ONE layer ?

PostPosted: Tue Aug 01, 2006 5:19 pm
by StarFishDesign
Hello again,

After some preworking - drawing gfx, composing music and searching suitable sfx - I started with my game...

Now I've implemented a nice feature: shadow of the player's ship on elements below. But what, if there is space below thos elements? The shadow will show up on the space-layer too ;) (see screenshot)

Image

You can see the shadow on the wreck-layer and on the space layer too.
Both layers are scrolling on different speeds... I only want the shadow to appear on the wreck-layer. Any body an idea?

Thanks!

PostPosted: Tue Aug 01, 2006 7:18 pm
by irblinx
If your ship moves at a constant speed you could use collision detection on the wreck/shadow to turn on/off your shadow.

I.e. set up filled region actors parented to the shadow, one at the front and one at the back to turn on and off respectively, you'd probably have to cheat with the edge colours of the wreck to make this smooth though.

PostPosted: Tue Aug 01, 2006 7:23 pm
by StarFishDesign
Thanks, but I meant that the shadow will appear on the wreck during flight.
With collision I can only switch it on and off, not make it appear line for line to look good... know what I mean?

PostPosted: Tue Aug 01, 2006 10:07 pm
by MaDsk8tard
solution : remove your shadow or make a full dark background ^^

for me , it's impossible to do what you want with GE ;)

PostPosted: Tue Aug 01, 2006 10:21 pm
by StarFishDesign
MaDsk8tard wrote:solution : remove your shadow or make a full dark background ^^

for me , it's impossible to do what you want with GE ;)


Haha :x
Umm, let`s see...

PostPosted: Wed Aug 02, 2006 2:29 am
by DilloDude
As far as I can figure, you'd need script to draw on a canvas. The problem is that drawing transparency can take a fair bit of performance, so you'd want to optimize it to only draw where there was a change.

PostPosted: Wed Aug 02, 2006 8:26 am
by Hyperyon
On the shadow add collision with space layer and make it transparent. Then allow shadow to appear on wreck layer with another collison event.
Of course the space and wrecks should be separate actors. I'm not sure what yur pushing for, but thats what I'd do :)

PostPosted: Wed Aug 02, 2006 7:22 pm
by StarFishDesign
Hyperyon wrote:On the shadow add collision with space layer and make it transparent. Then allow shadow to appear on wreck layer with another collison event.
Of course the space and wrecks should be separate actors. I'm not sure what yur pushing for, but thats what I'd do :)


Thanks, that worked... but the shadow only disappears when completely moved outside the wreckage layer. So the player can see the shadow some seconds on the space layer until it disappears.

Damned... :(

PostPosted: Wed Aug 02, 2006 7:59 pm
by Hyperyon
Try making an addition with collision finish with wreks and destroy actor shadow :?

PostPosted: Wed Aug 02, 2006 8:02 pm
by StarFishDesign
Hyperyon wrote:Try making an addition with collision finish with wreks and destroy actor shadow :?


I already did that.
The solution was the above mentioned 1-2 second gap where the player can see the shadow on the space-layer :(

PostPosted: Wed Aug 02, 2006 8:29 pm
by makslane
You can try make a fade. This will minimize the user perception.

PostPosted: Wed Aug 02, 2006 8:31 pm
by StarFishDesign
makslane wrote:You can try make a fade. This will minimize the user perception.


Hmm, thats an option.
You're right ... I'll give it a try tomorrow.
Thanks!

PostPosted: Wed Aug 02, 2006 10:21 pm
by MaDsk8tard
good idea for the fade ;)