Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (576)
games submitted by our members
Games in WIP (497)
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 ... 14
1  Game Development / Newbie & Debugging Questions / Re: Best way to do loading screens and resource management? on: 2014-04-15 05:30:24
You can consider doing texture streaming. Theagentd did a great job of explaining it in this article. Basically, you load up all textures with really low resolution. Then, if you are going to render the texture, you load the full resolution photo. You also limit the number of texture loads per frame so that you don't stutter too bad. Anyways, you should really check it out because it's a great explanation.
2  Game Development / Newbie & Debugging Questions / Re: Best way to do loading screens and resource management? on: 2014-04-14 05:43:11
For sounds and textures I would use something more flexible like an ArrayList or a HashMap so that I can vary the amount of textures and also (if I really need to) remove them and not ruin the whole thing.
3  Games Center / WIP games, tools & toy projects / Re: Element X on: 2014-04-14 03:12:19
Also make sure you're using .equalsIgnoreCase() to compare the commands
4  Game Development / Newbie & Debugging Questions / Re: Faster transformation with VBOS on: 2014-04-13 19:17:09
You have to leave those enabled or else nothing will get passed to the shader.
5  Game Development / Newbie & Debugging Questions / Re: Faster transformation with VBOS on: 2014-04-13 15:59:27
So you're saying
glDisableVertexAttribArray(0);
before rendering?
6  Game Development / Newbie & Debugging Questions / Re: Faster transformation with VBOS on: 2014-04-13 15:43:19
No. You want the shader active when you render or else it won't be used!
7  Games Center / WIP games, tools & toy projects / Re: Element X on: 2014-04-13 03:23:41
Ok. It works with that.
8  Games Center / WIP games, tools & toy projects / Re: Element X on: 2014-04-13 03:16:21
Looks good. I couldn't spawn anything in though (got null pointer exception when run in the console). Other than that, it ran nicely. Loved the stick onionade!
9  Game Development / Newbie & Debugging Questions / Re: Faster transformation with VBOS on: 2014-04-12 22:44:52
The easiest and probably fastest way to do this would be to do this in a vertex shader for constantly updating data.

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
// Modifies the matrix to translate
public void translate(int x, int y)
{
     transformMatrix.m03 -= x;
     transformMatrix.m13 -= y;
}

public void render()
{
     glBindBuffer(GL_ARRAY_BUFFER, vertid);
     glBufferData(GL_ARRAY_BUFFER, vertices, GL_DYNAMIC_DRAW);

     glEnableVertexAttribArray(0);
     glVertexAttribPointer(0, 2, GL_FLOAT, false, 2 * 4, 0);

     // Draw using glDrawArrays or glDrawElements

     glDisableVertexAttribArray(0);
}


Then you should be multiplying in your vertex shader

1  
2  
3  
4  
5  
6  
7  
8  
attribute vec2 position;

uniform mat4 transformation;

void main()
{
     gl_Position = transformation * vec4(position, 1.0, 1.0);
}


EDIT:
I should note that the transformation matrix should start as an identity with m00, m11, m22, and m33 having a value of 1.
10  Java Game APIs & Engines / OpenGL Development / Re: Per-pixel lighting (NO SHADERS!) on: 2014-04-11 06:29:28
Yep. GLSL will make your life a whole lot easier. But, just to answer your question:

1  
2  
float lightStrength = 1.2f;
transparency = distance.getLength()/(50f * lightStrength);
11  Discussions / Business and Project Discussions / Re: Sound/Music Artists. on: 2014-04-11 05:42:07
Yep. Composing music and creating sounds is a nice back-burner project. I found this (piano roll composer) which is a very simple midi composer but it is easy and free. I've created a few songs with it. Pointing Bfxr is a nice synthesizer that you can use to create sound effects.
12  Discussions / General Discussions / Re: Need C programs to practice for debugging competition on: 2014-04-06 04:53:45
Look closer  Wink
13  Game Development / Newbie & Debugging Questions / Re: Making texture tiles on: 2014-04-06 03:52:47
Are you referring to that image loading? Because he's already printing a stack trace.
14  Game Development / Newbie & Debugging Questions / Re: Making texture tiles on: 2014-04-05 21:37:12
I'm not too sure what you are asking but I think that this is what you mean.

1  
2  
3  
4  
5  
6  
7  
for(int i= 0; i < map.length; i++) // Iterate through all your map elements
{
     for(int j = 0; j < map[0].length; j++)
     {
          g.drawImage(texture[map[i][j]], x, y); //Draw the texture on the map. e.g. map[0][0] = 2; so you are drawing it like texture[2]
    }
}


So your map would hold integers of what textures you want to draw.

You will probably want a class to hold all your information like hwinwuzhere suggested. Then you would change your map to hold that tile class instead of Integers.

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  
// In your main class
public Tile[][] map = new Tile[16][14];

public void paint(Graphics g)
{
     for(int i = 0; i < map.length; i++)
          for(int j = 0; j < map[0].length; j++)
               map[i][j].draw(g, textures);
}

// In another file
public class Tile
{
     private int id, x, y;

     public Tile(int id, int x, int y)
     {
          this.id = id;
          this.x = x;
          this.y = y;
     }

     public void draw(Graphics g, BufferedImage[] textures)
     {
          g.drawImage(textures[id], x, y);
     }
}


I hope this helps. Smiley
15  Games Center / WIP games, tools & toy projects / Re: Platformer - SAGL 1.0 on: 2014-04-05 00:36:55
Initially, the maps are not the same. But later on he loads the map that he saved from the first game Pointing
16  Discussions / General Discussions / Re: Creating dev team Java 2d!! on: 2014-04-04 21:50:55
How much time do I need per day?
- about 1 - 2h is OK then I mean then you need to code not playing around and just being in Skype.
- else if like 6 - 12h pew day would be awesome that's my time so having 3 more members with that time = OP!

6-12h! Wow. Congrats on finding ANYONE who wants to work for that long without earning anything.
17  Discussions / General Discussions / Re: Creating dev team Java 2d!! on: 2014-04-04 20:46:45
Knowledge, you might not know something another team member knows

There are already two great places for that. Google and JGO
18  Discussions / General Discussions / Re: Creating dev team Java 2d!! on: 2014-04-04 20:08:36
Do I get paid for this =D!?
NO! why?
we create 2d games

What makes you think that 2D games can't make money?

Hmm...?
- the team are gona make video etch week on the game and it's process, I will be the recorder cause its
my channel but all the team mates channel will be showed in video ofcorse / or you can record you to.

It seems like you are focusing more on your audience than an actual game. Make a game first and then people will want to know more about your game.

What are you looking for!?
- Java programmers 1 - 3 years experience 2 years is OK to!
. Graphics artist 1, we don't really need more then 1 but if that guy has friend that want to help sure...!

So you're asking for people with more experience than you and yet you are the team leader?

I am confused by about half of this post. You seem to like to go off on tangents instead of focusing on recruiting people for a team. Also, you need to have some sort of prototype to get people interested in this. I would suggest working on a game for a while and then come back and try to get people to join your team.
19  Game Development / Newbie & Debugging Questions / Re: [LibGDX] Ball bouncing problem on: 2014-04-04 19:16:49
I am having a hard time reading your code. A little formatting and good variable names will help people read your code.

I would suggest using vectors. Libgdx has a 2d vector class built in. For example:

1  
Vector2 velocity = new Vector2(1, 3).nor().scl(3); // Creates a velocity vector pointing up and to the right with length of 3 (speed of 3)


Using this kind of code you can move the ball a lot easier

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
// This makes the ball bounce off flat walls
if(collisionRight || collisionLeft) // If there is a collision on the right or left side of the ball
{
     velocity.x = -velocity.x; // Reflect the x velocity
}
else if(collisionTop || collisionBottom) // If there is a collision on the top or bottom of the ball
{
     velocity.y = -velocity.y; // Reflect the y velocity
}

// Then you update the ball's position
ballPosX += velocity.x;
ballPosY += velocity.y;


I would also recommend you use a collision manager so that you can have the ball react differently with different types of obstacles. For example:

1  
2  
3  
4  
5  
6  
// This would make the ball bounce off faster than it hit
if(ball.collides(glass))
{
     velocity.x = -velocity.x * 2;
     velocity.y = -velocity.y * 2;
}


Using a bit of math, you can use vectors with elliptical objects too but if you are wanting collisions with irregular objects then I would suggest using box2d.

20  Java Game APIs & Engines / Java 2D / Re: Java topics needed to learn game dev on: 2014-04-04 16:52:43
It sounds like you need to learn java. Don't get too excited and jump into making games or else you will just give up. There are many tutorials and I think that we have a thread on this site for java tutorials (just use the search bar). You can go check out thenewboston on YouTube for java tutorials also.

Again, just to repeat myself, DONT jump straight into games. Learn java first.
21  Java Game APIs & Engines / Engines, Libraries and Tools / Re: [LibGDX]Draw laser beams(LaserFX) on: 2014-04-02 23:10:59
The AtlasRegion is just part of the TextureAtlas that specifies only a certain part of the whole image. You could instead use a simple TextureRegion to get the texture coordinates. The returned  float array is all of your vertex data. I'm not sure about libgdx but I believe that you can use this method
draw(Texture texture, float[] spriteVertices, int offset, int length)
to draw a texture with the custom data.
22  Java Game APIs & Engines / Engines, Libraries and Tools / Re: [LibGDX]Draw laser beams(LaserFX) on: 2014-04-02 19:50:15
What about all that code at the bottom. Isn't that sufficient? I just read through the article and I don't understand where you are getting lost. Could you explain your problem?
23  Discussions / General Discussions / Re: What do you do to cut development time? on: 2014-04-02 19:13:54
I have to resist the pull of the internet. Cheesy
24  Game Development / Newbie & Debugging Questions / Re: Beginner Design Questions on: 2014-04-02 19:04:51
Map.Entry cannot resolved to be a type. I am still looking through it and trying to figure it out. Help is really appreciated.
It is because longarmx probably just copied code from his game, and it includes a class called Map.entry, which you don't have, because only he has it.

1  
2  
3  
4  
import java.util.Map.Entry;

for(Entry<Integer, Key> entry : keys.entrySet())
     keys.get(entry.getKey()).update();


I found that code somewhere online when trying to figure out how to iterate through a hashmap.

Start trying to use a good code design.

Yep. Make an effort to use a good code design. At least try to use standard coding conventions and object-oriented practices.
25  Game Development / Newbie & Debugging Questions / Re: Beginner Design Questions on: 2014-04-01 20:19:36
I prefer classes like this keyboard handler because it provides me with an easier way to get which keys are down or not. Also, "pressed" is nice to have because then you can easily execute something only once.
26  Discussions / General Discussions / Re: JGO Kickstarter on: 2014-04-01 03:03:56
Still nothing. Logged out & back in, cleared cookies, and tried different browsers to no avail.
27  Discussions / General Discussions / Re: JGO Kickstarter on: 2014-04-01 02:59:10
I can't seem to figure out how to pledge. You mean clicking on the sliver medal by the backers right? Clicking it does not do anything.

Also, am I entitled to the "LONG ARM" ranking? Cheesy
28  Game Development / Newbie & Debugging Questions / Re: Beginner Design Questions on: 2014-04-01 02:51:44
@OP That switch statement looks good except that you need breaks at the end of every case statement so that it doesn't execute the ones after it.

@trolllwarrior1 I would use a hasmap instead. It eliminates the need to loop through your list on every key press and release. Pointing Sorry if you feel like I am bashing you. I am just rambling on at this point.

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  
public class KeyboardHandler implements KeyListener {

     private HashMap<Integer, Key> keys = new HashMap<Integer, Key>();

     Key KEY_W = new Key(KeyEvent.VK_W);
     Key KEY_A = new Key(KeyEvent.VK_A);
     Key KEY_S = new Key(KeyEvent.VK_S);
     Key KEY_D = new Key(KeyEvent.VK_D);

     public KeyboardHandler(){}

     public void update()
     {
          for(Map.Entry entry : keys.entrySet())
               keys.get(entry.getKey()).update();
     }


     public class Key
     {
          public boolean down = false, pressed = false;
          private boolean wasDown = false;

          public Key(int keyCode)
          {
               keys.put(keyCode, this)
          }
     
          public void update()
          {
               pressed = !wasDown && down;
               wasDown = down;
          }
     }

     @Override
     public void keyPressed(KeyEvent event)
     {
          keys.get(event.getKeyCode()).down = true;
     }

     @Override
     public void keyReleased(KeyEvent event)
     {
          keys.get(event.getKeyCode()).down = false;
     }
}

29  Game Development / Newbie & Debugging Questions / Re: Beginner Design Questions on: 2014-03-31 18:07:18
No. Start with good code design. You don't want to fall into bad habits.
30  Discussions / Miscellaneous Topics / Re: new computer purchase advice on: 2014-03-31 16:15:52
I agree with princec. Get a dedicated graphics card (gtx 500 series or AMD equivalent). Also, an i5 will give you the nice boost in performance. That 350w power supply might give you trouble though. I would go onto neweggs power supply calculator and make sure you would have at least 50 watts of buffer.
Pages: [1] 2 3 ... 14
 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

xsi3rr4x (12 views)
2014-04-15 18:08:23

BurntPizza (10 views)
2014-04-15 03:46:01

UprightPath (24 views)
2014-04-14 17:39:50

UprightPath (10 views)
2014-04-14 17:35:47

Porlus (27 views)
2014-04-14 15:48:38

tom_mai78101 (49 views)
2014-04-10 04:04:31

BurntPizza (107 views)
2014-04-08 23:06:04

tom_mai78101 (207 views)
2014-04-05 13:34:39

trollwarrior1 (176 views)
2014-04-04 12:06:45

CJLetsGame (182 views)
2014-04-01 02:16:10
List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:05:20
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!