Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (498)
Games in Android Showcase (116)
games submitted by our members
Games in WIP (563)
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  Games Center / WIP games, tools & toy projects / Re: Mind the Gap [0.18] on: 2014-06-09 13:03:59
The level editor shrinks/zooms the camera to fit the screen. Guards have no AI right now because there's no way to fight them. Thanks for the review! Cheesy
2  Games Center / WIP games, tools & toy projects / Mind the Gap [0.18] on: 2014-06-09 03:40:43
Hey, just wanted to show a game I've been working on over the past few weeks. It's kind of BattleBlock Theater art-styled and it's based around subways. Uses Slick2D by Kevin Glass, and the wonderful music of Kevin MacLeod! (thanks to both Kevins!)
Download is here: http://dl.dropboxusercontent.com/u/32129384/MTG/MTG-pre-alpha-0.18.zip

WARNING: There are no levels past 1-1. Attempting to access an invalid level may crash the game! I've been more concerned about actual technical details of the game at the moment rather than level design. Try out the level editor! Framerate is locked at 125 if you're wondering.


Level 1-1 (subject to change)


Level editor

Some details:
Controls: arrow keys, space to jump
Level editor: lclick to place, rclick to remove, middleclick to copy, lctrl for menu, hold tab for colours
The levels are block ids (not the greatest) stored with 3 more bytes of colour data. Potentially you could modify the level files to contain custom colours (RGB)
3  Game Development / Newbie & Debugging Questions / Re: Tiled Based Lighting not working up and left on: 2013-04-07 01:33:29
I have solved the issue. it might be a temporary one, but it works! I just put my original code after the recursive code, and it seems to work. I'll work out a better solution later.
4  Game Development / Newbie & Debugging Questions / Re: Tiled Based Lighting not working up and left on: 2013-04-07 00:39:49
This is just an optional question, but is there a way to make the framerate not so pathetic (used to be about 80 fps, now with lighting is 11 fps avg.)?
5  Game Development / Newbie & Debugging Questions / Re: Tiled Based Lighting not working up and left on: 2013-04-06 23:30:42
Works all fine and dandy, also fixed the lightValue <= 0 thing, but now it looks like this:


I also cut out the boundary checker here, but it's still in the code (to reduce lines)
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
public void lightSource(int x, int y, int lightValue) {
      if(lightValue <= 0) return;

      if(x == -1 && x > limitx && y == -1 && y > limity){
         //System.out.println("out of bounds " + x + " " + y + " " + limitx + " " + limity);
        return;
      }
       if ((light[y][x] >= lightValue) && lightValue > 0) { // Well, the light has already been set here, we can stop here.
         // System.out.println("light already set");
         return;
       }
     
       light[y][x] = lightValue;
       lightValue -= 1; // need to implement yourself
      // recursiveness:
     
     
      if(x - 1 != -1){
         lightSource((x - 1), y, lightValue);
      }
      if(y - 1 != -1){
         lightSource(x, (y - 1), lightValue);
      }
     
      if(x + 1 != limitx){
         lightSource((x + 1), y, lightValue);
      }
     
      if(y + 1 != limity){
         lightSource(x, (y + 1), lightValue);
      }
       
   }
   public void light() {
       // for each light source:
     for(int i = 0; i < limity; i++){
         for(int x = 0; x < limitx; x++){
            light[i][x] = 0; //darken to current time of day
        }
      }
     
     
     
      for(int by = ty; by < my; by++){
         for(int bx = tx; bx < mx; bx++){//for each block in the area
           if(layer2[by][bx].lightlevel > 0){ //for each LIGHT SOURCE
              lightSource(bx, by, layer2[by][bx].lightlevel);
               
            }else light[by][bx] = 0;
         }
      }
   }


I'm guessing it has something to do with the return statements not processing the rest of the lighting.
6  Game Development / Newbie & Debugging Questions / Re: Tiled Based Lighting not working up and left on: 2013-04-06 23:18:25
Also, my arrays go [Y][X], and not [X][Y]
7  Game Development / Newbie & Debugging Questions / Re: Tiled Based Lighting not working up and left on: 2013-04-06 22:56:41
I implemented the code and it only seems to make a ray of light going up. I'll look at it again, and fix it Tongue
EDIT: got a ton of errors of ArrayIndexOutOfBounds -1, and sometimes StackoverFlow errors.
8  Game Development / Newbie & Debugging Questions / Re: Tiled Based Lighting not working up and left on: 2013-04-06 22:52:35
Thanks! The very long code section was checking boundries for the world limit >.<

This really helps! Thanks! Cheesy

EDIT: sorry, layer2[][] is a block layer, and each block has a lightvalue of how much they give off.
9  Game Development / Newbie & Debugging Questions / Tiled Based Lighting not working up and left on: 2013-04-06 18:24:50
I have an issue where my tile based lighting code is not functioning properly going up and left. It works properly going right and downward (see image), but only goes one tile to the left/up and doesn't continue like it should. http://i.imgur.com/DAM1pg2.png

My code seems correct; I have placed print statements to check values (removed in sample) and it seems alright.

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
54  
55  
56  
57  
58  
59  
60  
61  
62  
63  
64  
65  
66  
67  
68  
69  
70  
71  
72  
73  
74  
75  
76  
77  
78  
79  
80  
81  
82  
83  
84  
85  
86  
87  
88  
public void light(){
     
     
      for(int i = 0; i < limity; i++){
         for(int x = 0; x < limitx; x++){
            light[i][x] = 0; //darken to current time of day
        }
      }
     
      int ty = (p.desiredy/32)-16;
      int tx = (p.desiredx/32)-16;
      if(ty > limity){
         ty = limity - 1;
      }
      if(ty < 0){
         ty = 0;
      }
      if(tx > limitx){
         tx = limitx - 1;
      }
      if(tx < 0){
         tx = 0;
      }
      int my = ty + 32;
      int mx = tx + 32;
      if(my > limity){
         my = limity - 1;
      }
      if(my < 0){
         my = 0;
      }
      if(mx > limitx){
         mx = limitx - 1;
      }
      if(mx < 0){
         mx = 0;
      }
     
      for(int by = ty; by < my; by++){
         for(int bx = tx; bx < mx; bx++){//for each block in the area
           if(layer2[by][bx].lightlevel > 0){ //for each LIGHT SOURCE
              light[by][bx] = layer2[by][bx].lightlevel;
               
            }else light[by][bx] = 0;
         }
      }
     
     
     
      for(int by = ty; by < my; by++){
         for(int bx = tx; bx < mx; bx++){//for each block in the area, do adjacent check
           
            if(light[by][bx] > 1){
               
               //now do blocks adjacent
              //left, right, up, down
              //must do a check for blocks, otherwise exception
              //then check if block is DARKER than itself
              if(bx - 1 != -1){
                  if(light[by][bx - 1] < light[by][bx]){
                     
                     light[by][bx - 1] = light[by][bx] - 1;
                  }
               }
               if(by - 1 != -1){
                  if(light[by - 1][bx] < light[by][bx]){
                     light[by - 1][bx] = light[by][bx] - 1;
                  }
               }
               
               if(bx + 1 != limitx){
                  if(light[by][bx + 1] < light[by][bx]){
                     light[by][bx + 1] = light[by][bx] - 1;
                  }
               }
               
               if(by + 1 != limity){
                  if(light[by + 1][bx] < light[by][bx]){
                     light[by + 1][bx] = light[by][bx] - 1;
                  }
               }
               
            }
         }
         //System.out.println("end of y loop, " + ty + " " + my);
     }
     
   }
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.

radar3301 (12 views)
2014-09-21 23:33:17

BurntPizza (30 views)
2014-09-21 02:42:18

BurntPizza (22 views)
2014-09-21 01:30:30

moogie (20 views)
2014-09-21 00:26:15

UprightPath (28 views)
2014-09-20 20:14:06

BurntPizza (32 views)
2014-09-19 03:14:18

Dwinin (48 views)
2014-09-12 09:08:26

Norakomi (74 views)
2014-09-10 13:57:51

TehJavaDev (102 views)
2014-09-10 06:39:09

Tekkerue (50 views)
2014-09-09 02:24:56
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

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

HotSpot Options
by dleskov
2014-07-08 01:59:08
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!