Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Battle City area

Posted on 2001-07-01
8
Medium Priority
?
480 Views
Last Modified: 2008-03-10
Hi all,

I want to create a game like the old Nintendo Battle City, tank shooting game. I'm really confuse with the data structure of the area, which contain bricks, water, grass, etc. Should i use array ? or linked list ? because the bricks can be shooted.

Thank you very much
0
Comment
Question by:cobramania
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 53

Expert Comment

by:Ryan Chong
ID: 6246874
Hi cobramania,

I'm not verry sure which is the best way to do this. But if i want to create a game like "Battle City", i would prefer data structure, or a 2 dimension UDT array rather than a normal array.
0
 
LVL 2

Expert Comment

by:smitty1276
ID: 6247026
If you know the exact size of the playing area, you should probably just keep a two-dimensional array of "tiles" for the different types of terrain (grass, dirt, brick, walls, etc.).
0
 
LVL 1

Author Comment

by:cobramania
ID: 6247172
i know the exact size, 26x26 array, with 16x16 pixel image each bricks,
the problem is, that bricks, can be shoot and break into smaller bricks.
That part make me confuse, since that shot actually just paint a black rectangle at the brick.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 3

Expert Comment

by:HDE226868
ID: 6247520
You better use some sort of array. Use 2D array or simulate it with a simple array. If a brick falls apart just delete the big brick info and enter small bricks where they should be.

I don't know the game You are talking about, but I think I some impression. I'll speculate about a game, where there are buildings and other things placed on a terain consisting of land, water, etc. Tanks can not move over objects unless they are destroyed, but if an object is destroyed, tanks can move over, but something remains, where destroyed object was.

For instance You can use descriptors for each field. Describe terrain somewhat like this: grass = 0, water = 1, sand = 2, etc. Describe objects then like this: no object = 0, brick = 1, small brick = 2, tree = 3, etc. And describe reamins like this: no remains = 0, brick remains = 1, plant remains = 2, etc.

I've selected things so, that of each group (terrain, objects, remains) only one type can be at the same place. So if brick is destroyed, You just put the value of the object descriptor for that place to 0 and its remains descriptor to 1. If there was a mayor explosion and remains spread, You can also affect neighbour places.

How to implement it:
Create tiles for Your terrain (grass, sand, water, whatever You need - ussually the problem is, how to do it, so that the boundary between terrain types appear nice)

Objects and remains I suggest You define the way You define Your tanks (as sprites).

When You create Your terrain, You first put Your terrain part, then put Your objects on it (take care of transparencies).

Whenever something changes, You just need to redraw terrain for that spot and put its objects on again.
0
 
LVL 1

Author Comment

by:cobramania
ID: 6247989
Hi HDE226868,

your answer is close, but not enough, do you have email address so i can send you the NES ROM. You can examine it first, the solution you gave me, i already know that before, but the game is not like that, take a look at the rom, and try to play for a while, you'll see that your answer is not enough :)

Thank you very much
0
 
LVL 3

Expert Comment

by:HDE226868
ID: 6251296
You can also try to explain the problenm, but still my e-mail is: uros.kejzar@ensico.si
0
 
LVL 54

Expert Comment

by:nico5038
ID: 7375181

No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
 - PAQ'd and pts removed
Please leave any comments here within the
next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

Nic;o)
0
 
LVL 5

Accepted Solution

by:
Netminder earned 0 total points
ID: 7400548
Per recommendation, points NOT refunded and question closed.

Netminder
CS Moderator
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As game developers, we quickly learn that Artificial Intelligence (AI) doesn’t need to be so tough.  To reference Space Ghost: “Moltar, I have a giant brain that is able to reduce any complex machine into a simple yes or no answer. (http://www.youtu…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question