Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (513)
Games in Android Showcase (120)
games submitted by our members
Games in WIP (577)
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  Game Development / Newbie & Debugging Questions / Generating Algorithm on: 2014-05-08 19:04:29
Hi there,

I'm trying to add a feature to my game where a region is created dynamically using a combination of a pre-existing region.
This part of the game will be a sort of adventure where the place is different every time.


This is a picture of the original location, when called, the server would copy parts of this region and make an instance of a new region.

This new region will always have the coordinates [6, 6] as the starting room. Each room has a certain number of doors used to get across each room.

Here's a picture of the new region and all the potential spots the rooms can be placed.

1  
2  
3  
4  
5  
new DungeonFloor(new int[] { 8, 632 }, FloorType.BASE_FLOOR, new int[] { NORTH, SOUTH, EAST, WEST }),
      new DungeonFloor(new int[] { 8, 630 }, FloorType.BASE_FLOOR, new int[] { NORTH, SOUTH, WEST }),
      new DungeonFloor(new int[] { 8, 628 }, FloorType.BASE_FLOOR, new int[] { NORTH, SOUTH, }),
      new DungeonFloor(new int[] { 8, 626 }, FloorType.BASE_FLOOR, new int[] { SOUTH, WEST }),
      new DungeonFloor(new int[] { 8, 624 }, FloorType.BASE_FLOOR, new int[] { SOUTH }),

      
Here's a picture of the dungeons.
The parameters are as follows
[] { regionX and regionY } // Used to copy the original location
Type of floor
The door directions of that original location

These are all the same room except the doors are different. Each room can be rotated to make the doors work.

The problem:
I need an algorithm that finds a starter floor with the correct number of doors, places it at (6, 6).
Places the best boss floor at any region
makes a map around the boss floor covering x number of rooms. x being a parameter that's sent with the method call.
Spawns a room for the map coordinates, finding the best room (depending on the number of doors it has) and rotates it so it works out perfectly.

The code so far:
1  
2  
3  
4  
5  
6  
7  
List<DungeonFloor> allFloors = Arrays.asList(DungeonRepository.DUNGEON_FLOORS);
List<DungeonFloor> starterRooms = new LinkedList<DungeonFloor>();

for (DungeonFloor floor : allFloors) {
   if (floors.type() == FloorType.BASE_FLOOR)
   starterFloors.add(floor);
}


Help  Huh
2  Games Center / Showcase / Re: Syniobots [Desktop] on: 2014-05-08 18:37:48
Damn this looks nice
3  Discussions / General Discussions / Re: Programmer jokes on: 2014-05-08 18:36:02
LMFAO this one got me XD
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.

Longarmx (52 views)
2014-10-17 03:59:02

Norakomi (44 views)
2014-10-16 15:22:06

Norakomi (34 views)
2014-10-16 15:20:20

lcass (38 views)
2014-10-15 16:18:58

TehJavaDev (68 views)
2014-10-14 00:39:48

TehJavaDev (68 views)
2014-10-14 00:35:47

TehJavaDev (60 views)
2014-10-14 00:32:37

BurntPizza (73 views)
2014-10-11 23:24:42

BurntPizza (45 views)
2014-10-11 23:10:45

BurntPizza (87 views)
2014-10-11 22:30:10
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
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!