Page 2 of 2

Re: Tanks - terrain question

PostPosted: Thu Jul 23, 2009 7:14 am
by Fuzzy
Very basic.

Press the mouse and six green globs of dirt appear. If they appear in the same place as a previous glob, it will pile up.

Making holes with bullets is exactly the same, except you subtract the globs(makePile). you can just give a negative value to make pile.

Height[] holds the values made by the piles. You can use these values to drive across the terrain. You dont need gravity. I didnt put tanks in because you already know how to move across the screen. just use
Code: Select all
player.y=Height[player.x]


Bullets collide with the ground in the exact same way as player drives on it. compare bullet.y against Height[bullet.x] for collisions. Then use makePile with a negative size.

I also didnt smooth the terrain. You can improve that.

Am I forgetting anything? Ah yes. Dont forget to clear the screen or the piles will not shrink.

Re: Tanks - terrain question

PostPosted: Thu Jul 23, 2009 11:17 am
by Camper1995
Thanks all. Bee ant, I know how to make top view. But I am asking for side view like in that game, you know when is terrain one big actor and when bullet
collide with it, how to make hole in to it.

I know I am boring, but I cant be good programmer without learning all tricks in GE and you know,...

I am making games with Game Edtiro 3 years, but that 2 years I was just searching what is what because I was not good in english. It was hard for me to learn in GE
when I cant speak good english... :D

Thx,

Camper

Re: Tanks - terrain question

PostPosted: Thu Jul 23, 2009 11:19 am
by Camper1995
LOL Fuzzy, I dont see your post, This is that what I need. :)

Just, is there any way to be that terrain more rounded?

I mean this is too spiky for tanks. :D

Thank you.

Re: Tanks - terrain question

PostPosted: Fri Jul 24, 2009 12:46 am
by Fuzzy
Camper1995 wrote:LOL Fuzzy, I dont see your post, This is that what I need. :)

Just, is there any way to be that terrain more rounded?

I mean this is too spiky for tanks. :D

Thank you.


You certainly could smooth them out after, or you could do it in the phase where they are laid down. The function makePile() is in two for sections. each one of those creates a ramp effect. The first one creates a slope on the left, the second one slops back down.

The system I used for a demo was simply to show how it worked. I think if I expanded it, I would set things so that it was independent of the screen size, and that the laid down dirt would be more smooth.

Smoothing the hills would involve making the piles wider and/or less tall.

I am extremely hesistant to expand the demo. It wouldnt take much to make a complete game, which is what you are doing. How fair would that be?

On the other hand, if I did, I wouldnt be bothered by you making one also.

So its up to you. Want to see more?

Re: Tanks - terrain question

PostPosted: Fri Jul 24, 2009 10:16 am
by Camper1995
No man, thanks. You help me ;)

Re: Tanks - terrain question

PostPosted: Fri Jul 24, 2009 3:18 pm
by Bee-Ant
I would like to see more...
its rare for you to make a demo...