Java-Gaming.org Hi !
Featured games (81)
games approved by the League of Dukes
Games in Showcase (513)
Games in Android Showcase (119)
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 / Re: java grid collsions detection on: 2012-09-01 08:15:37
yea but it still does not explain how to make the grid, it just repeats everything i have read elsewhere Tongue and i understand all of that i just don't know how to create the grid
2  Game Development / Newbie & Debugging Questions / Re: java grid collsions detection on: 2012-08-31 22:12:11
yea i see Tongue but does anyone know of any tutorials or just something that explains the way to make it ?
3  Game Development / Newbie & Debugging Questions / Re: java grid collsions detection on: 2012-08-31 22:06:11
i really don't know lol, never worked with a grid before but i am going to check for collisions with objects in the cell yes.. but i havfe no idea of how to create "the grid" and so on xD
4  Game Development / Newbie & Debugging Questions / java grid collsions detection on: 2012-08-31 14:59:17
hey guys i have been trying to browse youtube and JGO for any tutorials on grid based collision detection but i can't seem to find any also i need to be able to build maps out of blocks so i need the grid for that aswell Tongue any help appreciated as its my first game ever and im struggling a bit Tongue
5  Game Development / Newbie & Debugging Questions / creating a level from an image :) im doing progress but i need help :P on: 2012-08-29 15:50:41
hey guys i started working on a class that would take an image and turn it into a map and im progressing Cheesy i have converted all the pixels into hex color codes and stored them in array and everything is working fine Tongue except when im trying to all the createMap method to actually create the tiles :/ its throwing me a nullPointerException and i can't seem to find the reason Tongue any suggestions ?

code:

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  
public class Level {
   
   public static BufferedImage createDataArray(BufferedImage level) {
      String[] pixels = new String[level.getHeight() * level.getWidth()];
      BufferedImage out = level;
      for(int x = 0;x < level.getHeight(); x++) {
         for(int y = 0; y < level.getWidth();y++) {
            int rgb = level.getRGB(x, y);
            String hex = Integer.toHexString(rgb & 0x00ffffff);
            pixels[x+y] = hex;
         }
      }
      createMap(pixels);
      return out;
   }
   
   public static void createMap(String[] pixels) {
      for(String s : pixels) {
         if(s.equals("000000")) {
            System.out.println("wall");
         }
         if(s.equals("06941a")) {
            System.out.println("grass");
         }
      }
   }
}
6  Game Development / Newbie & Debugging Questions / Re: Creating a level/map from an image using RGB and do collision detection on: 2012-08-28 20:58:58
yes i see Tongue and yes it is to advanced lol i jsut want the barebones atm Wink back to topic:

uhmm yea i am really struggling with finding any resources on this Tongue could anyone maybe explain me the proccess of converting each pixel into RGB values and so on ? Tongue i really just want to know how to do this lol

EDIT: i started just messing around with pixels and shit for maybe an hour or so and made a method to read the getRGB of every pixel in an image and store it in a array as an integer Smiley the problem now is that this is a sample output:

328965

and i thought RGB was like "eee9e9" or "220-220-220" so idk how to use that when its not a "RGB" to me xD i hope someone can explain this Tongue
7  Game Development / Newbie & Debugging Questions / Re: Creating a level/map from an image using RGB and do collision detection on: 2012-08-28 20:36:05
yea im more into 2D atm as i said its my first game Tongue and could u explain a litlle how it works ?
8  Game Development / Newbie & Debugging Questions / Creating a level/map from an image using RGB and do collision detection on: 2012-08-28 20:23:44
hey guys Smiley i know java very well now but i have never actually made a proper game, so i wanted to start making a game Tongue and yea it did not take to long until i got stuck a few times xD well i have seen some people use images and convert them into maps/levels using RGB data and i would like to know more about how this works and especially how u collsion detects the "blocks"/tiles after rendering the map in-game

basicly:
gimme as much information as possible on this subject! xD
9  Game Development / Newbie & Debugging Questions / Re: LWJGL how would i draw an image ??? on: 2012-07-13 22:58:22
yea as i am new to LWJGL and i know java pretty well i like to make my own algorithms and such Tongue i don't really have any reason other than that, im not hating on slick tho its a great engine and i have used it b4 i just want to see how i would do without it
10  Game Development / Newbie & Debugging Questions / Re: LWJGL how would i draw an image ??? on: 2012-07-13 22:00:11
as i said i don't want to use anything else than LWJGL really Tongue
11  Game Development / Newbie & Debugging Questions / LWJGL how would i draw an image ??? on: 2012-07-13 21:53:43
hey there guys i am new to this forum, but im not new to java allthought im new to LWJGL, my question is bascily ... how would i load and draw a image in LWJGL ? i am not using slick and i am not going to use it either Tongue umm that really sums it all up, thanks
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 (49 views)
2014-10-17 03:59:02

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

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

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

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

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

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

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

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

BurntPizza (84 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!