Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (580)
games submitted by our members
Games in WIP (500)
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 ... 8
1  Discussions / Miscellaneous Topics / Re: What are Anti-Virus Developers Protecting us From? on: 2014-04-18 16:58:02
I use kaspersky Pure 3.0.Used internet security before... Dude, its awesome.
No virus whatsoever.After i installed i ran some checks with another antiviruses to check if kaspersky was really working and it is.
Just fine.
kaspersky removes files without asking and you can't restore it. It destroyed my custom sound-driver and it killt the software I used for playing with www.hackthissite.org and some other stuff. (And yes the software was clean)
I bought it but after the first day I removed it  Smiley
2  Discussions / General Discussions / Re: [LIBGDX] Particles disappearing and then reappearing on: 2014-04-06 14:43:12
But anyways, an Immutability-modifier would be awesome in java.
1  
private immutable Object o; //if you try to change a value inside o an ImmutableExeption will be thrown


It's not that easy... There is reflection too and stuff like that. It's possible to change the
char[]
inside a String via reflection, although the String should actually be immutable.
It doesn't have to throw an exception if you use reflection.
it just should throw an exception if you do something like

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
class Whatever{
String myString;

immutable Whatever w; //if you try to change a value inside o an ImmutableExeption will be thrown


void test(){
 w.myString = "wasd"; //throw exception
w.setString("wasd2");

}

void setString(String s){
 this.myString = s; //throw exception
}
}
3  Discussions / General Discussions / Re: [LIBGDX] Particles disappearing and then reappearing on: 2014-04-05 23:36:03
Thanks for the help Phil. I have the code looking similar to what you put, but I kept it closer to my original way so that the transition looks better.
Working for up to 200k particles, when I hit 300k it slows down to a snails crawl.
No problem  Smiley

Immutability for the win!

Should all functional languages rise! Grin

(This is probably a dangerous statement in a java forum  persecutioncomplex ... Anyways, go on, I didn't want to derail Roll Eyes )
The quizz is done, the participant won, the quiz-(not even close to master) has to go  Roll Eyes

But anyways, an Immutability-modifier would be awesome in java.
1  
private immutable Object o; //if you try to change a value inside o an ImmutableExeption will be thrown
4  Discussions / General Discussions / Re: [LIBGDX] Particles disappearing and then reappearing on: 2014-04-05 23:13:42
Yes you got it Smiley

I would change:
In Particle.class
1  
2  
3  
4  
5  
   /** The color of the particle. */
   private final Color color = new Color();

and in the constructor:
      color.set(COLOR);


in RainbowSnow.class
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
   private final Color snowColor = new Color();
   /**
    * Updates the snow.
    */

   public void update() {
     snowColor.set(red/255f, green/255f, blue/255f, 1.0f);
      if(counter == 10) {
         for(int i=0;i<RANDOM.nextInt(1800) + 120;i++) {
            newParticle(snowColor, RANDOM.nextInt(8), 40);
            }
         counter = 0;
      } else {
         counter++;
      }
...


Are you always writing so many comments in your code? That's nice Smiley
5  Discussions / General Discussions / Re: [LIBGDX] Particles disappearing and then reappearing on: 2014-04-05 23:08:52
Yes it's because in java2d if you had 471 particles you had 471 colors.

Back to your code:
So what would happen if you create 5 red particles.
Then you take one particle and set the color to blue. What color will the 4 other particles have? You use color.set(...)
6  Discussions / General Discussions / Re: [LIBGDX] Particles disappearing and then reappearing on: 2014-04-05 22:56:39
Yes but the code is working.
Just concentrate on the update-method in rainbowSnow  Smiley
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
       Color c = new Color();
       c.set(red/255f, green/255f, blue/255f, 1.0f);
      if(counter == 10) {
         for(int i=0;i<RANDOM.nextInt(1800) + 120;i++) {
            newParticle(c, RANDOM.nextInt(8), 40);
            }
         counter = 0;
      } else {
         counter++;
      }

So, how many particles do I get if counter == 10? How many colors do those particles have?
7  Discussions / General Discussions / Re: [LIBGDX] Particles disappearing and then reappearing on: 2014-04-05 22:51:03
Yours should look like:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
 DIFF: lastAlpha: 0.9939099 color.a 0.9889625
 DIFF: lastAlpha: 0.9925706 color.a 0.9889625
 DIFF: lastAlpha: 0.9736842 color.a 0.9889625
 DIFF: lastAlpha: 0.9019608 color.a 0.9889625
 DIFF: lastAlpha: 0.97652584 color.a 0.9889625
 DIFF: lastAlpha: 0.875 color.a 0.9889625
 DIFF: lastAlpha: 0.99233127 color.a 0.9889625
 DIFF: lastAlpha: 0.98316497 color.a 0.9889625
 DIFF: lastAlpha: 0.96428573 color.a 0.9889625
 DIFF: lastAlpha: 0.954955 color.a 0.9889625
 DIFF: lastAlpha: 0.9904398 color.a 0.9889625
 DIFF: lastAlpha: 0.99360615 color.a 0.9889625
 DIFF: lastAlpha: 0.9934124 color.a 0.9889625
 DIFF: lastAlpha: 0.99291784 color.a 0.9889625
 SAME: lastAlpha: 0.9889625 color.a 0.9889625


if your snowflakes work properly it should look like:

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  
 SAME: lastAlpha: 0.9868735 color.a 0.9868735
 SAME: lastAlpha: 0.97713095 color.a 0.97713095
 SAME: lastAlpha: 0.9790476 color.a 0.9790476
 SAME: lastAlpha: 0.97393364 color.a 0.97393364
 SAME: lastAlpha: 0.98256737 color.a 0.98256737
 SAME: lastAlpha: 0.92142856 color.a 0.92142856
 SAME: lastAlpha: 0.98253965 color.a 0.98253965
 SAME: lastAlpha: 0.978 color.a 0.978
 SAME: lastAlpha: 0.98509485 color.a 0.98509485
 SAME: lastAlpha: 0.9586466 color.a 0.9586466
 SAME: lastAlpha: 0.97951585 color.a 0.97951585
 SAME: lastAlpha: 0.9859155 color.a 0.9859155
 SAME: lastAlpha: 0.973301 color.a 0.973301
 SAME: lastAlpha: 0.8513514 color.a 0.8513514
 SAME: lastAlpha: 0.95849055 color.a 0.95849055
 SAME: lastAlpha: 0.9763441 color.a 0.9763441
 SAME: lastAlpha: 0.9691877 color.a 0.9691877
 SAME: lastAlpha: 0.7708333 color.a 0.7708333
 SAME: lastAlpha: 0.98286605 color.a 0.98286605
 SAME: lastAlpha: 0.97759676 color.a 0.97759676
 SAME: lastAlpha: 0.97577095 color.a 0.97577095
 SAME: lastAlpha: 0.98214287 color.a 0.98214287
 SAME: lastAlpha: 0.98651963 color.a 0.98651963
 SAME: lastAlpha: 0.7924528 color.a 0.7924528
 SAME: lastAlpha: 0.9822581 color.a 0.9822581
 SAME: lastAlpha: 0.98073554 color.a 0.98073554
 SAME: lastAlpha: 0.98677886 color.a 0.98677886
 SAME: lastAlpha: 0.9808028 color.a 0.9808028
 SAME: lastAlpha: 0.9740566 color.a 0.9740566
 SAME: lastAlpha: 0.97736627 color.a 0.97736627
 SAME: lastAlpha: 0.9832317 color.a 0.9832317
 SAME: lastAlpha: 0.97002727 color.a 0.97002727
 SAME: lastAlpha: 0.976087 color.a 0.976087
 SAME: lastAlpha: 0.959854 color.a 0.959854
 SAME: lastAlpha: 0.9860936 color.a 0.9860936
 SAME: lastAlpha: 0.98410404 color.a 0.98410404
....

So there should be something wrong with your color.
8  Discussions / General Discussions / Re: [LIBGDX] Particles disappearing and then reappearing on: 2014-04-05 22:42:00
hint 3: Your error is pure java

Your methods should look like this

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  
      private float lastAlpha;
   /**
    * Updates the particle's position, change in x, change in y,
    * remaining lifetime, and color.
    * @return Whether the particle is 'dead' or not.
    */

   public boolean update() {
      if(x > SCREEN_DIMENSIONS.width + 32 || x < -32 || y > SCREEN_DIMENSIONS.height + 32) {
         return true;
      } else {
         x += dx;
         y += dy;
         dx += GRAVITY_X;
         dy += GRAVITY_Y;
         currentLife--;
         lastAlpha = (float)(currentLife/TOTAL_LIFE);
         color.set(color.r, color.g, color.b, lastAlpha);
         return (currentLife <= 0 ? true : false);
      }
   }

   /**
    * Renders the particle to the screen.
    * @param G The shaperenderer object to render with.
    * @param IS_OVAL Whether or not to render the particle as an oval.
    */

   public void render(final ShapeRenderer SHAPE_RENDERER, final boolean IS_OVAL) {

      if(lastAlpha != color.a){
         System.out.println(" DIFF: lastAlpha: " + lastAlpha+ " color.a "+ color.a);
      }else{
         System.out.println(" SAME: lastAlpha: " + lastAlpha+ " color.a "+ color.a);
      }
     
      SHAPE_RENDERER.setColor(color);

      if(IS_OVAL) {
         SHAPE_RENDERER.circle((int)x-(SIZE / 2), (int)y-(SIZE / 2), SIZE, SIZE); //x-(size/2) & y-(size/2) make sure the particle is rendered at (x, y).
     } else {
         SHAPE_RENDERER.rect((int)x-(SIZE / 2), (int)y-(SIZE / 2), SIZE, SIZE); //x-(size/2) & y-(size/2) make sure the particle is rendered at (x, y).
     }
   }


hint 4: Why should the last calculated alpha be different from color.alpha?
9  Discussions / General Discussions / Re: [LIBGDX] Particles disappearing and then reappearing on: 2014-04-05 22:31:54
It took me 1.3 hours to find it, I love debugging. Indeed I just hate to not know the solution  Roll Eyes
So I will go for a quizz  Grin
(No that's not because I am evil, that's just how some other guy helped me and you learn most)
First hint:
You create an object but you don't use it every time you create it.


The Color object in the update() method of the RainbowSnow class? Moving that within the if statement gives no change.
Good job, next hint.
add this in Particle.java

1  
2  
3  
4  
5  
6  
7  
lastAlpha =(float)(currentLife/TOTAL_LIFE); //in your update method in Particle

if(lastAlpha != color.a){ //in your render method
        System.out.println(" DIFF: lastAlpha: " + lastAlpha+ " color.a "+ color.a);
      }else{
         System.out.println(" SAME: lastAlpha: " + lastAlpha+ " color.a "+ color.a);
      }
10  Discussions / General Discussions / Re: [LIBGDX] Particles disappearing and then reappearing on: 2014-04-05 22:25:59
It took me 1.3 hours to find it, I love debugging. Indeed I just hate to not know the solution  Roll Eyes
So I will go for a quizz  Grin
(No that's not because I am evil, that's just how some other guy helped me and you learn most)
First hint:
You create an object but you don't use it every time you create it.
11  Discussions / General Discussions / Re: [LIBGDX] Particles disappearing and then reappearing on: 2014-04-05 22:17:12
I found your error. Hell that's a shitty one  Grin
I shouldn't tell you because you shouldn't code that way  Smiley
12  Game Development / Newbie & Debugging Questions / Re: creating an array of images and setting a timer on: 2014-04-02 22:12:18
You should give more information  Smiley

That's the first topic: http://www.java-gaming.org/topics/making-walk-cycle-for-2d-game/32641/msg/305638/view.html#msg305638
13  Discussions / General Discussions / Re: Coming back... on: 2014-04-01 19:02:09
You stopped working on a project because someone on the internet told you and now you are asking some random internet guys if you should continue  Roll Eyes

Honest answer:
Don't restart if you need other people to tell you what to do, because in that case you will fail anyway.
You aren't making games for us, as long as they don't get popular they are just for you and because you enjoy creating them.
14  Java Game APIs & Engines / Engines, Libraries and Tools / Re: [LibGDX]Draw laser beams(LaserFX) on: 2014-03-31 21:08:57
Have you ever used opengl, if yes have you used spriteBatching yet?
15  Java Game APIs & Engines / Engines, Libraries and Tools / Re: [LibGDX]Draw laser beams(LaserFX) on: 2014-03-31 20:59:18
You pass the mesh (vertices) to the gpu
16  Games Center / WIP games, tools & toy projects / Re: MERCury - 2d Game Engine on: 2014-03-30 22:30:29
we also have commandline. "[command] ? " is usefull. it says what type args should have.
[command.part].? shows all commands that start with the command-part (Because we were to lazy to implement a preview  Smiley )
for example:
debug.?
shows debug.log, debug.drawfps, etc.
17  Game Development / Networking & Multiplayer / Re: How do you configure a router with Java to make it... on: 2014-03-30 19:42:12
@Pauler
Well, it is my hope to be able to publish the game so that anyone can download it and host a server so it'd be really good if I could include some code in the server to open a port in the router automatically when the server starts up. After all, it's good if your game can be used easily by anyone, even those who aren't good at computers.
Haha that's quite funny, a software that opens ports on any router. Noone will give you his router pw. If you get it working without knowing the password you are on the dark side and quite good at being bad  Wink
But after all you shouldn't need to open ports.
18  Games Center / Showcase / Re: [Android Libgdx] Catman on: 2014-03-29 13:55:49
Nice one  Smiley
Some gameplay stuff that could be improved,
-sometimes it seems to be impossible because of bananas
-some coins can't be reached - you die if you try to get them because the point of view is to small
-decrease upward movement on tap while flying
You might wanna have a look at: http://www.youtube.com/watch?v=ea6UuRTjkKs

But all in all good work  Wink
19  Game Development / Game Mechanics / Re: Handling re-size in a voxel engine on: 2014-03-28 21:52:19
Thanks for the reply, but its 2D, and I meant the blocks only render down to a certain point. I was wondering how to handle that certain point when the display is re-sized enough.
You use that point just the way you used the first one?
20  Discussions / General Discussions / Re: is anybody using this system of redering to?! on: 2014-03-26 22:32:43
I am currently using chunks, so there are entities drawn outside the screen if the chunk is partly inside  Smiley
21  Discussions / General Discussions / Re: Fewer end users? on: 2014-03-26 22:30:27
I never have any of those issues. I's because most people just buy a computer and use express-installation because they have no idea what they are actually doing.
It's like driving a car without any driving lesson. I don't think that it's a java-problem as oracle smashed buggy applets with shitty signing.
In addition most people don't even "know" java. They installed it because their computer told them to do so and use the applications but they have no idea what they are using.
So I don't see any reason to encourage someone to trust Java again,  because in the end the amount people who "care about the weakness of java" (in my opinion useless and old-fashioned) is insignificant. I haven't met a non-programmer, and those who blame java are mostly don't know what they are talking about, that complains about java security-issues  Roll Eyes
22  Discussions / Miscellaneous Topics / Re: Advice on dealing with internet trolls? on: 2014-03-25 16:41:33
I haven't met a troll yet, but maybe that's just because I never collect mushrooms.
Let's go on a mushroom foray  Cranky
But we should have a look at Grunnt, his name is one of those undercover-troll-names  persecutioncomplex
23  Game Development / Newbie & Debugging Questions / Re: [LIBGDX] Need optimize load images on: 2014-03-25 09:10:27
do you render the complete background?
24  Game Development / Game Play & Game Design / Re: Sharing custom levels. on: 2014-03-15 17:18:38
I would use a php server and put the levels into a database (in my case I would use mysql)  Smiley
25  Game Development / Game Play & Game Design / Re: Should I just use one thread - the main thread? on: 2014-03-15 17:16:27
Don't care about performance if you don't have issues.
Have you ever created a game?
No offence, just a little thought I have, a lot of people spend to much time on theorie and never get something done.

I think all of the games you see on jgo are perfectly fine with one thread. Using multithreading efficiently is quite hard and you might get a lot of troubles Smiley
26  Java Game APIs & Engines / Engines, Libraries and Tools / Re: [LibGDX]Do we really need OrthographicCamera? on: 2014-03-13 21:04:16
To have y pointing upwards: orthographicCamera.setToOrtho(false);
You have to flip the textureregion or use sprite if the texture is upside down.
27  Game Development / Newbie & Debugging Questions / Re: [LibGDX] How to render a image parabolically on: 2014-03-13 19:19:39
I would use a mesh, but maybe there is a better solution, for example a shader Smiley
28  Java Game APIs & Engines / Engines, Libraries and Tools / Re: [LibGDX]Making a game work for desktop AND android? on: 2014-03-13 11:35:24
You have to write the input for each plattform yourself,
but you should opimize the game for one plattform  Smiley
29  Game Development / Newbie & Debugging Questions / Re: [Android] Managing your Android app keystore on: 2014-03-13 09:52:17
write it down on a piece of paper and keep it in a box somewhere
+1
I have folders (hardware), which contain all essential information that I have to remember  Smiley
30  Game Development / Newbie & Debugging Questions / Re: [LIBGDX] scene2d minimap on: 2014-03-12 10:18:13
I don't think that there is need for a second stage. You should really explain what you are trying to accomplish (More then one sentence)  Smiley
Pages: [1] 2 3 ... 8
 

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

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

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

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

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

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

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

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

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

CJLetsGame (208 views)
2014-04-01 02:16:10
List of Learning Resources
by SHC
2014-04-18 03:17:39

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
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!