Tanks - terrain question

Non-platform specific questions.

Re: Tanks - terrain question

Postby Fuzzy » Thu Jul 23, 2009 7:14 am

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.
Attachments
TankMountains.zip
(1.74 KiB) Downloaded 120 times
Mortal Enemy of IF....THEN(and Inspector Gadget)

Still ThreeFingerPete to tekdino
User avatar
Fuzzy
 
Posts: 1068
Joined: Thu Mar 03, 2005 9:32 am
Location: Plymostic Programmer
Score: 95 Give a positive score

Re: Tanks - terrain question

Postby Camper1995 » Thu Jul 23, 2009 11:17 am

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
Say hello to my little friend.
User avatar
Camper1995
 
Posts: 707
Joined: Tue Dec 30, 2008 7:20 pm
Location: Lost in the past.
Score: 44 Give a positive score

Re: Tanks - terrain question

Postby Camper1995 » Thu Jul 23, 2009 11:19 am

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.
Say hello to my little friend.
User avatar
Camper1995
 
Posts: 707
Joined: Tue Dec 30, 2008 7:20 pm
Location: Lost in the past.
Score: 44 Give a positive score

Re: Tanks - terrain question

Postby Fuzzy » Fri Jul 24, 2009 12:46 am

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?
Mortal Enemy of IF....THEN(and Inspector Gadget)

Still ThreeFingerPete to tekdino
User avatar
Fuzzy
 
Posts: 1068
Joined: Thu Mar 03, 2005 9:32 am
Location: Plymostic Programmer
Score: 95 Give a positive score

Re: Tanks - terrain question

Postby Camper1995 » Fri Jul 24, 2009 10:16 am

No man, thanks. You help me ;)
Say hello to my little friend.
User avatar
Camper1995
 
Posts: 707
Joined: Tue Dec 30, 2008 7:20 pm
Location: Lost in the past.
Score: 44 Give a positive score

Re: Tanks - terrain question

Postby Bee-Ant » Fri Jul 24, 2009 3:18 pm

I would like to see more...
its rare for you to make a demo...
User avatar
Bee-Ant
 
Posts: 3723
Joined: Wed Apr 11, 2007 12:05 pm
Location: http://www.instagram.com/bee_ant
Score: 210 Give a positive score

Previous

Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron