So when the game start, computer will random generate the terrain and when you fire and the shot hit the terrain,
it will make hole in to it... Is this possible with GE?
http://www.webgames.cz/tanks/289-1/
Thank you,
CAmPeR.

skydereign wrote:If you notice in that demo you gave, the holes were set in animation. So if you are doing what Bee-Ant suggested, then you should just have a collision event. Upon collision with the destroying object, increase the animpos, or change animation, so it is more beat up looking. Eventually the terrain will get destroyed, just like the game.
if(animpos==5)
{
DestroyActor("Collide Actor");
animpos++;
DestroyActor("Event Actor");
}
Fuzzy wrote:There is a more realistic way. You need an array as big as the max x of the screen. use things like sin and cos to generate some values, storing them in the array, after multiplying them by the max height you want. If you use random you will have to smooth the array values.
Step through the array, drawing lines to a canvas from the number in the array down to the bottom.
Thats your height field.
Next, whenever the tank gets hit, check to see if he is higher than the pixels at his x value. if so, make him fall.
When firing, trace the shot, figure out where it will be next draw. if that is a value that is greater than the value stored at that point of the array, then you have struck the ground.
To draw a pit, go back several pixels from the collision point and take some points out of that array box. then do the same, closer to the collision point. and so on, for a few pixels past the collision. next, redraw the ground using the array, and decide of any tanks are in the air.
Bee-Ant wrote:Fuzzy wrote:There is a more realistic way. You need an array as big as the max x of the screen. use things like sin and cos to generate some values, storing them in the array, after multiplying them by the max height you want. If you use random you will have to smooth the array values.
Step through the array, drawing lines to a canvas from the number in the array down to the bottom.
Thats your height field.
Next, whenever the tank gets hit, check to see if he is higher than the pixels at his x value. if so, make him fall.
When firing, trace the shot, figure out where it will be next draw. if that is a value that is greater than the value stored at that point of the array, then you have struck the ground.
To draw a pit, go back several pixels from the collision point and take some points out of that array box. then do the same, closer to the collision point. and so on, for a few pixels past the collision. next, redraw the ground using the array, and decide of any tanks are in the air.
????????????????
Users browsing this forum: No registered users and 1 guest