Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (577)
games submitted by our members
Games in WIP (498)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: 1 ... 6 7 [8] 9 10
 71 
 on: 2014-04-16 19:12:37 
Started by sonnyg007 - Last post by superminer362
Cool game! Your ship turns way too slow though, found myself firing into empty space instead of at the enemies. XD

EDIT: It's not a turning problem, it's just you can't shoot very accurately while strafing.

 72 
 on: 2014-04-16 18:44:38 
Started by Szymanski - Last post by kpars
Recently: Sound of the keyboard.

Mech guy as well? Cheesy

- Jev

 73 
 on: 2014-04-16 18:36:49 
Started by Hermasetas - Last post by Hermasetas
Sorry I uploaded the wrong shader code Tongue

The real one is up there now. Derp derp!

Thanks for pointing it out though Tongue

 74 
 on: 2014-04-16 18:36:38 
Started by Szymanski - Last post by Roquen
Recently: Sound of the keyboard.

 75 
 on: 2014-04-16 18:26:09 
Started by Hermasetas - Last post by Simn
Seems like your problem lies in the fragment shader. Why do you multiply the color with the texture color if you're not binding a texture? Try setting the output color to a constant value and see if it helps. Wink

 76 
 on: 2014-04-16 18:06:21 
Started by trollwarrior1 - Last post by actual
Personally I love flux. Every now and then I will turn it off to see how I do without it, but it never lasts long.

 77 
 on: 2014-04-16 18:01:48 
Started by Rayvolution - Last post by BurntPizza
Sound like a good plan. If you look back at the Minecraft thread, you see that's more or less what Notch did, and... well... you know how that turned out  Wink
(Still a freak occurrence, though)

 78 
 on: 2014-04-16 17:44:39 
Started by Rayvolution - Last post by Rayvolution
Well... that's what I'd do. I think it's basically not being replaced with anything; Steam is moving towards being open to everybody. The storefront though, that's a different matter.

Cas Smiley

So if you don't mind me asking, how do you keep interest/exposure up after the initial push to greenlight? I know initially you get a ton of exposure because you're basically on the front page a little while; but how do you keep it flowing after you drop off the radar?

Also, lets assume somehow by some black magic, I post my project and get greenlit a month later, what happens if my game is still 6+ months out from being released?
I've not myself ever used Greenlight, as I showed a bit of leg to the appropriate Valve rep Wink so my advice is maybe not so useful. But what I'd do in your situation is make sure the game is nearly finished and highly polished before I actually showed it to anyone (or you will immediately invite negative reaction as Jacob says). Then I'd make regular weekly updates to its progress and show it off at every opportunity. Same old same old really. Just that instead of your website where nobody ever goes, people (hopefully more of them) are looking at your Greenlight page.

Cas Smiley

Ah, sounds like I'm on the right track then. That was my original plan, I wasn't going to hit mainstream advertising until I had a functional alpha with a demo people could play that was pretty well polished. Right now really the only place I show off the game is here on JGO and within my own community, both places where people are more slanted to watch the development unfold that average gamers. Wink

 79 
 on: 2014-04-16 17:37:54 
Started by Hermasetas - Last post by Hermasetas
Hey guys!

I have made a 2D spritebatcher in LWJGL and it is working perfectly.
Now I am trying to make a shapeBatcher. Basicly it's a spriteBatcher but without the textures.
But when I test it I get nothing.. No errors, no shapes, nothing...
The only difference between my spritebatcher and my shapebatcher is that the shapebatcher does not use textures and it uses drawarrays instead of draw elements.

I am gonna paste the code for the shapebatcher below and if any of you can find the error I would be so happy! Been looking at it for hours..

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  
89  
90  
91  
92  
93  
94  
95  
96  
97  
98  
99  
100  
101  
102  
103  
104  
105  
106  
107  
108  
109  
110  
111  
112  
113  
114  
115  
116  
117  
118  
119  
120  
121  
122  
123  
124  
125  
126  
127  
128  
129  
130  
131  
132  
133  
134  
135  
136  
137  
138  
139  
140  
141  
142  
143  
144  
145  
146  
147  
148  
149  
150  
151  
152  
153  
154  
155  
156  
157  
158  
159  
160  
161  
162  
163  
164  
165  
166  
167  
168  
169  
170  
171  
172  
173  
174  
175  
176  
177  
178  
179  
180  
181  
182  
183  
184  
185  
186  
187  
188  
189  
190  
191  
192  
193  
194  
195  
196  
197  
198  
199  
200  
201  
202  
203  
204  
205  
206  
207  
208  
209  
210  
211  
212  
213  
214  
215  
216  
217  
218  
219  
220  
221  
222  
223  
224  
225  
226  
227  
228  
229  
230  
231  
232  
233  
234  
235  
236  
237  
238  
239  
package graphics;

import static org.lwjgl.opengl.GL11.*;
import static org.lwjgl.opengl.GL15.*;
import static org.lwjgl.opengl.GL20.*;
import static org.lwjgl.opengl.GL30.*;

import java.awt.Color;
import java.nio.FloatBuffer;

import org.lwjgl.BufferUtils;


public class ShapeBatcher
{
   private final static int MAX_NUMBER_OF_VERTICIES = 500;
   
   private int numberOfVerticies;
   
   private int shaderProgramID;
   private int projMatrixID;
   
   private boolean active;
   
   private int mode;
   private static final int LINEMODE = 0;
   private static final int FILLMODE = 1;
   
   private int vaoID;
   private int vboID;
   
   private FloatBuffer buffer;
   
   private Color color;
   
   public ShapeBatcher()
   {
      active = false;
      mode = LINEMODE;
      numberOfVerticies = 0;
      color = Color.WHITE;
     
      buffer = BufferUtils.createFloatBuffer(MAX_NUMBER_OF_VERTICIES*2);
     
      setupShader();
     
      setupBuffers();
   }
   
   private void setupBuffers()
   {
      //Setup VAO og aktiver de første 2 attributes
     vaoID = glGenVertexArrays();
      glBindVertexArray(vaoID);
      glEnableVertexAttribArray(0);
      glEnableVertexAttribArray(1);
           
      //Setup vertex-VBO
     vboID = glGenBuffers();
      glBindBuffer(GL_ARRAY_BUFFER, vboID);
     
      //Setup VAO pointers
     int bytesPerFloat = 4;
      int numberOfVertecies = 2;
      int numberOfColors = 4;
           
      int bytesPerVertex = (numberOfVertecies + numberOfColors) * bytesPerFloat;
     
      //Giv VAO'en vertex-VBO'en på index 0
     glVertexAttribPointer(0, 2, GL_FLOAT, false, bytesPerVertex, 0);
           
      //Giv VAO'en color-VBO'en på index 1
     int colorOffset = numberOfVertecies * bytesPerFloat;
      glVertexAttribPointer(1, 4, GL_FLOAT, false, bytesPerVertex, colorOffset);
   }
   
   private void setupShader()
   {
      //Lav vertexShaderen
     int vertexShaderID = ShaderUtils.createShader(GL_VERTEX_SHADER, "/graphics/ShapeVertexShader.txt", this);
     
      //Lav fragmentShaderen
     int fragmentShaderID = ShaderUtils.createShader(GL_FRAGMENT_SHADER, "/graphics/ShapeFragmentShader.txt", this);
     
      //Lav shaderProgrammet
     shaderProgramID = glCreateProgram();
      glAttachShader(shaderProgramID, vertexShaderID);
      glAttachShader(shaderProgramID, fragmentShaderID);
     
      //Fortæl shaderen hvor dens attributes er
     glBindAttribLocation(shaderProgramID, 0, "position");
      glBindAttribLocation(shaderProgramID, 1, "color");
     
      //Link og valider shaderProgrammet
     glLinkProgram(shaderProgramID);
      glValidateProgram(shaderProgramID);
     
      //Skaf projMatrix'ens ID
     projMatrixID = glGetUniformLocation(shaderProgramID, "projMatrix");
      if(projMatrixID == -1)
         new Exception("Kunne ikke finde projMatrixID").printStackTrace();;
     
      //Slet de to shadere igen da de ikke skal bruges mere
     glDeleteShader(vertexShaderID);
      glDeleteShader(fragmentShaderID);
   }
   
   /**
    * Tegner en linie fra et punkt til et andet
    * @param startX
    * @param startY
    * @param endX
    * @param endY
    */

   public void drawLine(int startX, int startY, int endX, int endY)
   {
      checkMode(LINEMODE);
      checkRender(2);
     
      float[] fColor = color.getComponents(null);
     
      //Første punkt i linien
     buffer.put(startX).put(startY);
      buffer.put(fColor);
     
      //Anden punkt i linien
     buffer.put(endX).put(endY);
      buffer.put(fColor);
     
      numberOfVerticies += 2;
   }
   
   public void fillRect(int x, int y, int width, int height)
   {
      fillTriangle(x, y, x, y+height, x+width, y+height);
      fillTriangle(x, y, x+width, y+height, x+width, y);
   }
   
   public void fillTriangle(int x1, int y1, int x2, int y2, int x3, int y3)
   {
      checkMode(FILLMODE);
      checkRender(3);
     
      float[] c = color.getComponents(null);
     
      //Første hjørne
     buffer.put(x1).put(y1);
      buffer.put(c);
     
      //Andet hjørne
     buffer.put(x2).put(y2);
      buffer.put(c);
     
      //Tredje hjørne
     buffer.put(x3).put(y3);
      buffer.put(c);
     
      numberOfVerticies += 3;
   }
   
   /**
    * Sender den nye projMatrix til shapeBatcherens shader.
    * Den aktiverer dermed sin shader, så den er aktiv efter denne funktion er blevet kaldt.
    * @param matrix
    */

   public void resize(FloatBuffer matrix)
   {
      glUseProgram(shaderProgramID);
      matrix.flip();
      glUniformMatrix4(projMatrixID, true, matrix);
   }
   
   public void setColor(Color c)
   {
      color = c;
   }
   
   public void activate()
   {
      active = true;
      glUseProgram(shaderProgramID);
   }
   
   public void deactivate()
   {
      active = false;
   }
   
   public void render()
   {
      //Hvis shapeBatcheren ikke er aktiv, så smid en exception
     if(!active)
         new Exception("ShapeBatcher'en er ikke aktiveret rigtigt!").printStackTrace();
     
      //Hvis der ikke er noget at tegne, så return
     if(numberOfVerticies == 0)
         return;
     
      //Send data'en til vbo'en
     buffer.flip();
      glBindBuffer(GL_ARRAY_BUFFER, vboID);
      glBufferData(GL_ARRAY_BUFFER, buffer, GL_DYNAMIC_DRAW);
     
      //Bind vao'en
     glBindVertexArray(vaoID);
     
      if(mode == LINEMODE)
         glDrawArrays(GL_LINES, 0, numberOfVerticies*2);
      else if(mode == FILLMODE)
         glDrawArrays(GL_TRIANGLES, 0, numberOfVerticies*3);
     
      //Reset batcheren
     buffer.clear();
      numberOfVerticies = 0;
   }
   
   /**
    * Tjekker om der er plads til flere shapes i batcheren
    * @param verticies Det antal verticies der skal tilføjes til batcheren
    */

   private void checkRender(int verticies)
   {
      if(MAX_NUMBER_OF_VERTICIES < (numberOfVerticies + verticies))
         render();
   }
   
   /**
    * Tjekker om batcheren er i den rigtige mode
    * @param mode Den mode der skal tjekkes for
    */

   private void checkMode(int mode)
   {
      if(this.mode != mode)
      {
         render();
         this.mode = mode;
      }
   }
}


The vertex shader:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
uniform mat4 projMatrix;

in vec2 position;
in vec4 color;

out vec4 pass_color;

void main()
{  
   gl_Position = projMatrix * vec4(position, 0.0, 1.0);
   
   pass_color = color;
}


The fragment shader:
1  
2  
3  
4  
5  
6  
7  
8  
in vec4 pass_color;

out vec4 out_color;

void main()
{  
   out_color = pass_color;
}


Potato!

 80 
 on: 2014-04-16 17:33:49 
Started by Szymanski - Last post by Jacob Pickens
I was joking. Haha Not trying to start anything.

Pages: 1 ... 6 7 [8] 9 10
 

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 (22 views)
2014-04-15 18:08:23

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

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

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

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

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

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

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

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

CJLetsGame (189 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!