2D Tank Game.

Posted By: Tutu

2D Tank Game. - 06/12/10 12:18

I want to build a 2D top view Tank game. I'm getting 2 problems....

1) Using -ve layer values in an Empty level disappears my Panels.

2) I want to use Multi-colored Image in which each color will have its significant meaning. Like GREEN mean grass, WHITE means snow, BLUE means water & many more. Using this I want to navigate through my game in which if the tank detects BLUE in front it will stop, if grass then okay to move, etc.


Please give me a solution for this problem.
Posted By: Joozey

Re: 2D Tank Game. - 06/15/10 14:32

I believe negative layers make it a (sky) background, thus indeed appear behind anything else. Start at 1000 or something if you need to go lower.
The manual says:
Quote:
A7.06 Panels, texts, and view entities with a positive layer value are placed above any view; with a negative layer value they are placed below any view. This can be used to define an image visible in the background of a view that has no sky and a transparent sky_color.


To detect you're in water or not, read about pixel_for_bmap in the manual. Check the pixel that is in front of the tank. If its value is blue, you know it's water.
© 2023 lite-C Forums