Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (109)
games submitted by our members
Games in WIP (536)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Java Game APIs & Engines / Java 2D / Re: a different tile technique on: 2005-02-14 03:05:57
hello.

firstly, thankyou both of you for replying to my question. they look like they will help me get what i want. im not able to try it out and integrat it into what i have at the moment, but i will do soon.
One of you said you were a buit unsure of my references to jpanels and the such. well i used jpanels as a dummy, just to see what i could do if a "tile" had a name.
Using my example of 4 tiles only, i call them tile1,tile2,tile3,tile4. each tile will have the food/wood/ore attributes but also the attribute picture.
a simple algorithm to be used (this is not written in java in this explanation) is using statements eg if..else.

1) tile1 will have a randomly generated number between one and five for each resource. if there are two fives, they are rerolled.
2) the highest number will dictate the type of terrain the tile is on. if there is a "five" then the other two attributes are changed to zero. ( a mixture of numbers eg 3 3 4 gives the attribute - rough)
3) so a "five" in food will class the tile as "grass". With the tile identified as "grass", the appropriate image is used on the tile.
4) the state of the first tile will dictate the state of the other tiles - this means if tile1 is "grass" then tile2 cannot be grass ( ie 5 food ), so tile2 has a "zero" for grass and so on.

i hope to use this to randomly generate different tiles. my use of jpanels was only because it was the only way that i knew of to actually give a tile an identifier. i do not intend to use them. i am aware that this theory is similar to turn based games, such as civilization, but i want to try to implement it into a different type of game. there is information out on the web, but 99% of it is visual basic or c++ ( i want java  Grin). the algorithms are not a problem , i just need to be able to assign those 3 values and be able to assign the appropriate picture to each one. hopefully the suggestions you gave me will allow me to do this :-)

thankyou.
2  Java Game APIs & Engines / Java 2D / a different tile technique on: 2005-02-13 22:00:13
hello everyone.

 i have been reading these forums for a while on game development and would like to ask you all a question  Grin

I would like to try something new, but have not found any information on the topic for java. this is what i want :-

1) create a screen of tiles (easy)
2) give each tile a name that the java program can  identify (cant do)
3) apply attributes to the tiles

the intended outcome will be related to resources, that is each tile will have a different number of resources. using co-ordinates i cant figure out how to do this (i can make tiles but i cant give them a name). i could use panels or buttons but i dont want outline visable.

can anyone give suggestions for this method?

an example of this method is as follows.

object name   food value   wood value    iron value

Tile1               5                   0                    0
Tile2               5                   0                    0
Tile3               0                   5                    0
Tile4               0                   0                    5

in the above example it is greatly simplified and consists of only 4 tiles. i believe that giving a tile an identifier will allow me to use algorithms to randomly generate different attributes for the tiles.
 Refering back to using buttons or panels - i can give these two objects attributes, because they have an identifier eg jpanel1 jpanel2 etc. i have not been able to get rid of outlines or apply art to them tho.

thank you in advance for any help/articles/webpages that are relavent.
Pages: [1]
 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

CogWheelz (18 views)
2014-07-30 21:08:39

Riven (26 views)
2014-07-29 18:09:19

Riven (15 views)
2014-07-29 18:08:52

Dwinin (13 views)
2014-07-29 10:59:34

E.R. Fleming (34 views)
2014-07-29 03:07:13

E.R. Fleming (12 views)
2014-07-29 03:06:25

pw (44 views)
2014-07-24 01:59:36

Riven (44 views)
2014-07-23 21:16:32

Riven (30 views)
2014-07-23 21:07:15

Riven (31 views)
2014-07-23 20:56:16
List of Learning Resources
by SilverTiger
2014-07-31 18:29:50

List of Learning Resources
by SilverTiger
2014-07-31 18:26:06

List of Learning Resources
by SilverTiger
2014-07-31 13:54:12

HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!