Java-Gaming.org Hi !
Featured games (85)
games approved by the League of Dukes
Games in Showcase (616)
Games in Android Showcase (173)
games submitted by our members
Games in WIP (659)
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] 2 3 ... 12
1  Java Game APIs & Engines / Java 2D / Re: 2D Minecraft-Like Game, Rendering issue. on: 2015-08-18 04:22:12
consider putting blocks into chunks so one chunk is 64 blocks so that's a 8x8 chunk
2  Game Development / Newbie & Debugging Questions / Re: Problem with splitting BufferedImage on: 2015-08-14 10:38:32
i want to get the data out off the map image and split in to smaller temp images
3  Game Development / Newbie & Debugging Questions / Problem with splitting BufferedImage on: 2015-08-14 03:28:29
so here is where the problem is

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  
   public void init(int worldSize, BufferedImage map){
      this.worldSize = worldSize;
      this.map = map;
     

      //createChunks
      int chunkW = map.getWidth() / worldSize;
      int chunkH = map.getHeight() / worldSize;
     
        int count = 0;
     
      BufferedImage imgs[] = new BufferedImage[chunkW*chunkH];
     
      for (int x = 0; x < worldSize; x++) {  
            for (int y = 0; y < worldSize; y++) {
            imgs[count] = new BufferedImage(chunkW, chunkH, map.getType());

              Chunk chunke = new Chunk(x*8*32, y*8*32,imgs[count++]);  
               chunkList.add(chunke);
           
            System.out.println(count+" IMG: "+map.getData()+" RGB: "+map.getRGB(x, y));
            }  
        }

      for(Chunk chunks : chunkList){
         chunks.initChunk();
      }
     
   }


what i'am trying to do is get 8 pixels out off the BF and create a chunk out off it then jump another 8 pixels and make a new chunk but they are all black when they go into the array why?

tell me if you need more info this is the chunk init

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
   public void initChunk(){
     
     
      if(currChunkImg != null){
         for(int w = 0; w < chunkSize; w++){
            for(int h = 0; h < chunkSize; h++){
                int rgb = currChunkImg.getRGB(w, h);
               
                switch(rgb & 0x000000){
                   case 0x000000:
                      blocks.add(new Block(pos.xpos + w*32,pos.ypos + h*32));
                  break;
//                   case 0xFFFFFF:
//                      blocks.add(new Block(pos.xpos + w*32,pos.ypos + h*32));
//                  break;
                }
               
               
            }
                 
         }
      }
     
   }


and when i render with
1  
g.drawImage(currChunkImg,(int)pos.xpos, (int)pos.ypos,64,64,null);

in the chunk class
it shows a black image
4  Games Center / WIP games, tools & toy projects / Re: Genesis (Survival Game) Java2D on: 2015-06-29 23:11:29
Where's Mr. Mustache? Clueless

it did not turn out as i expected so just went with this instead =P
5  Games Center / WIP games, tools & toy projects / Re: Mr.mustache (Survival Game) Java2D on: 2015-06-29 20:45:55
NEWS
Chunks Added
Inventory Added!
Background WIP
block gives Material
Loads of code performance and how the coding works with the game
new Textures for gold and iron that before looked like di##s
Health
Stamina
Hotbar for fast Access
ect...
6  Games Center / WIP games, tools & toy projects / Re: Mr.mustache (Wiggle Wiggle Wiggle) on: 2015-06-24 10:21:00
update:
new character
random ores
big map
tiles
added so when blocks get removed a backround tile shows

next update
add chunks
add the characters mining tool
add add/remove blocks
7  Games Center / WIP games, tools & toy projects / Re: Mr.mustache on: 2015-06-16 19:27:31
I think the first thing you should add are wiggling mustaches when pressing S.

added it check video above xD
8  Discussions / Miscellaneous Topics / Re: Free game/addon keys! :) on: 2015-06-16 18:34:20
Thanks Mate Your Awesome Smiley
9  Discussions / Miscellaneous Topics / Re: Free game/addon keys! :) on: 2015-06-16 18:26:57


i would love to have the ( SMITE Xbox One closed beta )
10  Games Center / WIP games, tools & toy projects / Re: Mr.mustache on: 2015-06-16 18:20:48
I think the first thing you should add are wiggling mustaches when pressing S.

good idea, we got the whole game right there xD
11  Games Center / WIP games, tools & toy projects / Genesis (Survival Game) Java2D on: 2015-06-16 13:59:12
Mr.mustache is on adventure finding the ultimate mustache, but he has a long mus.. i mean way to go!



GamePlay:well survive

Genre: Survival Game

Progress List:
8% done

Planned Controlls

W = jump
D = right
A = left

Got any ideas please post comments down below and if you want to see devlogs on this game, you can check my yt channel out Smiley will be uploading weekly devlogs Smiley
12  Games Center / WIP games, tools & toy projects / Re: Java 2D Multiplayer Coop Rpg on: 2015-06-08 20:33:11
looks cool =D
13  Game Development / Newbie & Debugging Questions / Re: Runnable and Thread on: 2015-05-28 19:59:17
You pass a Runnable instance to a constructor of a class implementing Runnable, and never using said instance. How's the Thread going to find out about the instance, and execute it? That, and a dozen race conditions, which can be ignored for now, given the nature of the previous issue. You might take a step back and consider mastering the essentials of the java language instead of plowing through like this.

this is why jgo sucks balls everybody can just say "learn essentials" jesus....
instead of helping...
14  Game Development / Newbie & Debugging Questions / Re: Runnable and Thread on: 2015-05-28 19:52:38
Wait, whoa. Why do you have a thread inside a Runnable?

You're calling start upon the class's runnable implementation, the object "thread" is never called because "start" is a function within the runnable interface.

could you tell me how to do this stuff xD never used threading that mutch xD give example on how to achieve this
15  Game Development / Newbie & Debugging Questions / Runnable and Thread on: 2015-05-28 19:40:02

My Runnable!
anyhelp it only prints out the seconds not what i print out here
1  
2  
3  
4  
5  
6  
7  
8  
9  
         LooterTimer timeTast1 = new LooterTimer(10, new Runnable(){

            @Override
            public void run() {
               System.out.println("200"); <-- I WANT THIS TO PRINT OUT!
            }

           
         });



LooterTimer

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  
package my.tdl.managers;

public class LooterTimer implements Runnable{

   private int defaultSeconds;
   private int seconds;
   private boolean hasCompleted;
   private boolean running;
   
   private Thread thread;
   
   public LooterTimer(int seconds, Runnable runnable) {
      this.seconds = seconds;
      this.defaultSeconds = seconds;
      start();
   }

   @Override
   public void run() {
      if(!running){
         running = true;
      }
     
      while(running){
         if(seconds != 0){
            System.out.println(seconds+" seconds left!"); <-- already printing!
            seconds -= 1;
            try {
               Thread.sleep(1000);
            } catch (InterruptedException e) {
               e.printStackTrace();
            }
         }
         
         if(seconds == 0){
            stop();
         }
      }
     
     
   }


   public void stop() {
      running = false;
      hasCompleted = true;
      seconds = defaultSeconds;
      thread.stop();
   }

   public void start() {
      running = false;
      hasCompleted = false;
      seconds = defaultSeconds;
      if(thread == null){
         thread = new Thread(this);
         thread.start();
      }
   }
   
   public boolean isRunning() {
      return running;
   }


   public boolean hasCompleted() {
      return hasCompleted;
   }

}

16  Game Development / Newbie & Debugging Questions / Re: Setting pixels make blur around pixel!!! on: 2015-05-05 15:21:51
You forgot to ask a question!

fixed it xD question is up there now!
17  Game Development / Newbie & Debugging Questions / Setting pixels make blur around pixel!!! on: 2015-05-05 15:08:56



method for setting pixel
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  
   public void setPixel(int x,int y, int col){
     
      for(int xx = 0 ; xx < x ; xx++){
         for(int yy = 0; yy < y ; yy++){
            int pixel = image.getRGB(x, y);
           
            int allP = (pixel >>> 16) & 0xFF & (pixel >>> 8) & 0xFF & (pixel >>> 0) & 0xFF;
           
            allP = col;

            int result = (pixel << 16) & 0xFF & (pixel << 8) & 0xFF & (pixel << 0) & 0xFF;
           
            System.out.println(result+"");
           
            if(result != col){
               image.setRGB(x, y, allP);
               System.out.println("Pixel At ["+"X: "+x+" Y: "+y+"]" +" Was Changed!");
               break;
            }else{
               System.out.println("Pixel At ["+"X: "+x+" Y: "+y+"]" +" Was Overriden!");
            }
         }
           
      }
     
   }



how do i fix so it does not do that!??!?!
18  Discussions / Miscellaneous Topics / Re: TheDungeonLooter (LiveStream Coding) (ONLINE!!!!) on: 2015-05-05 06:33:15
thanks mate will be using that from now on!
19  Game Development / Newbie & Debugging Questions / Re: How Do i Random Generate Something like this on: 2015-05-03 13:43:38
sounds good thanks for the help
20  Game Development / Newbie & Debugging Questions / How Do i Random Generate Something like this on: 2015-05-03 11:59:29
is there a way of random generating an image like this (real time) then load it into the game

like real time change 1 image to be like 100+ dungeons real time once



for ex i got this image

dungeon.png (just a blank image)

the code opens it somehow
random generates pixels to what ever they need to be
saves the image
then loads in into the game


(how i load map)
i check the pixels on the image then add blocks to different pixel colours
21  Discussions / Miscellaneous Topics / Re: TheDungeonLooter (LiveStream Coding) (Online!!!!) on: 2015-04-29 18:11:28
we live again
22  Discussions / Miscellaneous Topics / TheDungeonLooter (LiveStream Coding) (Offline!!!) on: 2015-04-19 07:47:37
http://www.twitch.tv/pijellypin


23  Games Center / WIP games, tools & toy projects / Re: GNetLib V0.0.0.3 (A Simple Java Networking Library) on: 2015-04-10 14:39:34
yeah, or just make a new project that is kinda similar to this so its easy to send and receive packets! Smiley
24  Discussions / Miscellaneous Topics / Re: java2D more dynamic lightning WIP on: 2015-03-26 19:28:49
<a href="http://www.youtube.com/v/2rD61qt4mGE?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/2rD61qt4mGE?version=3&amp;hl=en_US&amp;start=</a>

video =D
25  Discussions / Miscellaneous Topics / Re: java2D more dynamic lightning WIP on: 2015-03-25 20:21:18
i cant modify posts for some reason coos i'am still in padded room or what ever so here

the x over the screen defines the side you can click in with mouse to attack the 1.0 is the attack time when the first true is false
the other false goes to true when that is true the timer goes down when the timer == 0 the first true goes back to true Smiley
the dots just shows what blocks are being changed during lighting up Smiley
26  Discussions / Miscellaneous Topics / Re: java2D more dynamic lightning WIP on: 2015-03-25 20:19:52
the x over the screen defines the side you can click in with mouse to attack the 1.0 is the attack time when the first true is false
the other false goes to true when that is true the timer goes down when the timer == 0 the first true goes back to true Smiley
27  Discussions / Miscellaneous Topics / java2D more dynamic lightning WIP on: 2015-03-25 17:37:51
tell me what you think Smiley



forgot to render the light map above player xD
28  Discussions / Miscellaneous Topics / Re: Yay, free games! Zero's Game Giveaway on: 2015-03-20 21:48:55
get it humble bundle for 1$ with 3 other games =D
29  Game Development / Newbie & Debugging Questions / Re: ingame consol?? on: 2015-03-04 21:23:57
ok that helps little bit thanks =D
30  Game Development / Newbie & Debugging Questions / ingame consol?? on: 2015-03-04 21:14:41
how would i create so players can for example do commands like /help /commands /tp x y z

Pages: [1] 2 3 ... 12
 
Coldstream24 (18 views)
2015-09-03 00:41:28

Andrew_3ds (30 views)
2015-09-01 19:08:10

afikri (20 views)
2015-08-31 09:30:22

afikri (27 views)
2015-08-31 09:30:07

afikri (15 views)
2015-08-31 09:27:24

afikri (17 views)
2015-08-31 09:26:40

Roquen (32 views)
2015-08-29 11:30:54

GamerC4 (38 views)
2015-08-22 20:38:50

GamerC4 (36 views)
2015-08-22 20:37:18

GamerC4 (42 views)
2015-08-22 20:37:01
HotSpot Options
by Roquen
2015-08-29 11:33:11

Rendering resources
by Roquen
2015-08-17 12:42:29

Rendering resources
by Roquen
2015-08-17 09:36:56

Rendering resources
by Roquen
2015-08-13 07:40:51

Networking Resources
by Roquen
2015-08-13 07:40:43

List of Learning Resources
by gouessej
2015-07-09 11:29:36

How Do I Expand My Game?
by bashfrog
2015-06-14 11:34:43

List of Learning Resources
by PocketCrafter7
2015-05-31 05:37:30
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!