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   
Pages: [1]
  ignore  |  Print  
  How to stop weapon from creating a close circuit in j2me game.  (Read 4541 times)
0 Members and 1 Guest are viewing this topic.
Offline j2me_beginner

Junior Newbie





« Posted 2010-04-01 06:36:26 »

Quote
Hi, I like to know how to create logic for a weapon in the game which should not make a close circuit while place it on the game screen.
Its like there are (x,y) number of rows and columns. The user is allowed to place the weapon on the screen. The screen looks like a chess board. Full of odd number of rows and columns in the shape of squares.
Now the user can place the weapon on these squares so that as and when the enemies come they detect using collision and the if its on firing range they fire to the enemy.
So now the weapon can be placed such that it should not form a closed circuit, that is it should leave one square empty so that the enemy moves out.
The enemy has a start state and a goal state. And it moves in the form of elephant of a chess game.
The enemy starts from say suppose top of a screen and moves one one square and doj's the weapon and reaches other end of the screen.
SO i like to know how to stop the weapon from making a closed circuit?

In all total there are 9 columns and 11 rows, in all total 99 squares of 24 x 24 ok.
Weapons are places inside the squares. But it should not make a close circuit. Means I cannot block the whole row full of weapons. Say there should be a 24 x 24 cell left for the enemy to move around.

If i create a square or rectangle ,I should leave a 24 x 24 cell left so that the enemy passes through, from start state to the goal state.

For enemies I use A* algo. but for placing the weapons................dont know how.

The game is like iphone field runner. Kindly see the video in youtube and see how the weapons are placed and help me.
Offline Nate

JGO Kernel


Medals: 145
Projects: 4
Exp: 14 years


Esoteric Software


« Reply #1 - Posted 2010-04-01 08:15:12 »

Deja vu.

I find the best way to get help is to ask over and over again.

Offline j2me_beginner

Junior Newbie





« Reply #2 - Posted 2010-04-01 10:21:23 »

I tried but unfortunately not able to work it out. kindly guide me.............................
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline 1st4ck

Junior Newbie





« Reply #3 - Posted 2010-07-22 22:17:54 »

You have the monster with logic A* implemented them the soluction is really easy.

The monster logic is start at Point A and calc the path to point B.

So When you try to build a Weapon you make a check (Monster can you go now from A to B???) if the answer is false then this weapon will block the path so you prevent it.

Simple Cheesy
Offline t_larkworthy

Senior Member


Medals: 1
Projects: 1


Google App Engine Rocks!


« Reply #4 - Posted 2011-01-11 13:36:38 »

1st4ck is close. If monsters spawn at A and try to get to B you can double check there is always a path from A to B but that does not include the case that the player encloses a completely different area of the battlefield.

You want to ensure that *all* space is connected in one connected blob. Invoke a minimum spanning tree at A or B and check that the number of areas of space encountered = the total number of space tiles.  If you have A* coded, then spawn an A* with no goal, and terminate it when the queue is empty (count the unique empty spaces encounter and should equal the number of spaces on the field iff empty space is fully connected)

Runesketch: an Online CCG built on Google App Engine where players draw their cards and trade. Fight, draw or trade yourself to success.
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

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 (15 views)
2014-08-01 22:53:16

CogWheelz (15 views)
2014-08-01 22:51:43

CopyableCougar4 (16 views)
2014-08-01 19:37:19

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

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

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

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

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

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

pw (44 views)
2014-07-24 01:59:36
Resources for WIP games
by CogWheelz
2014-08-01 18:20:17

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

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
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!