character or object for a tank?

Started by Vinayak Garg, Fri 08/10/2010 08:26:21

Previous topic - Next topic

Vinayak Garg

Hi
First i would like to thank Chris for making and sharing such a nice Software.
I have started making classic Tank Game.
My main tank is a character. But i am confused on enemy tanks as well as "tank shells(firepower)". Should i make them Character or Objects ???
I myself am reading manual to see which one suits my requirement.
Any help is much appreciated.
Thanks
Vinayak Garg

GarageGothic

#1
Depends on how you set up the rest of the game (for instance does it have more than one room, do you use walkable areas etc.), but you can't really go wrong with characters, and they have the benefit of built-in support of multiple sprites for facing different directions, and can be reused in multiple rooms. I can't think of a single reason to choose objects over characters.

Personally I'd use DrawingSurface functions to render the bullets, but characters are fine too though you need to create a separate one for every bullet/shell on-screen at the same time.

Vinayak Garg

Quote from: GarageGothic on Fri 08/10/2010 09:41:46
Depends on how you set up the rest of the game (for instance does it have more than one room, do you use walkable areas etc.), but you can't really go wrong with characters, and they have the benefit of built-in support of multiple sprites for facing different directions, and can be reused in multiple rooms. I can't think of a single reason to choose objects over characters.

Personally I'd use DrawingSurface functions to render the bullets, but characters are fine too though you need to create a separate one for every bullet/shell on-screen at the same time.
Thanks for quick response. Yeah Characters suit my requirement(multiple sprites).
I have multiple rooms(levels), and each level has 10 tanks, with 4 displayed at a time. How should i go about it.

And i will read about Drawing Surface.
Thanks Again
Vinayak Garg

Ryan Timothy B

Just note that there is an on screen limit of how many characters AGS allows per room. I believe it's 40, but it could be 50. I can't remember. It's been a year or so since I discovered this, and have gone to using drawing surfaces since for making non adventure games.

Vinayak Garg

As i am solving 1 problem, 10 more Questions are popping up.
1-Can draw surface be used for showing image? I have read it shows geometric shapes.
2-How to detect collision? I can write my own function but is there any better way? i have tried iscollidingwithchar and ppcollision module. But they aint stopping overlap.

Help Sought
Vinayak Garg

GarageGothic

1) Check out DrawingSurface.DrawImage in the manual.
2) Write your own function, you'll need it anyway if you use DrawImage for the shells so you may as well use the same code for tank-to-tank collisions too.

Vinayak Garg

Hello
Thanks again.
I will follow your advice.
But Do i have to call that function (my own) in repeatedly_execute()?

Vinayak Garg

GarageGothic

Yes, call the collision detection function from repeatedly_execute().

SMF spam blocked by CleanTalk