Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (107)
games submitted by our members
Games in WIP (536)
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 ... 7
1  Discussions / General Discussions / Re: What? Your game isn't a pixelated retro masterpiece? on: 2014-07-18 16:41:16
I use pixel art for my work primarily because I just flat out suck at drawing. Nobody I know is any good with animation, and I find that I can do my best art when I don't need such a finite control on the art and pixels are great to hide that. I'll admit it, I won't call my games "Retro" or "8-bit", because I'm not using the same constraints that they had to abide by and attempt to work around back then. I'd personally rather have a minimalistic look to my games, which I believe can also be provided by pixels.
2  Games Center / WIP games, tools & toy projects / Re: [Slick2d] Retro-Pixel Castles > OFFICIAL WEBSITE LAUNCHED! < on: 2014-07-15 22:32:24
Just downloaded it to try it out. First thoughts, I'm digging all the art. Second thoughts, "Oh, I can only use the map editor". Third Thoughts, "Umm.. It crashes whenever I get to the loading map screen."
3  Game Development / Newbie & Debugging Questions / Re: Libgdx sound lag? [solved] on: 2014-07-14 14:01:51
Yeah, the clip ran perfectly fine on PC. I know I didn't do anything special for it because I downloaded it from freesound and didn't even look at the sample rate until there was an issue.
4  Game Development / Newbie & Debugging Questions / Re: Libgdx sound lag? [solved] on: 2014-07-14 04:53:01
Success has been had! I lowered the sample rate on the clip from about 96k to 44.1k. It plays perfectly fine now!
5  Game Development / Newbie & Debugging Questions / Re: Libgdx sound lag? on: 2014-07-12 03:50:33
Well I'm fairly certain that the issue is NOT with the phone lacking power. It's a newer Samsung Galaxy S4, and I've also run it on a couple of other newer phones as well.
6  Game Development / Newbie & Debugging Questions / Re: Libgdx sound lag? on: 2014-07-11 14:25:14
Well, here's my Audio.java class. It's not the greatest, but hey, I'm open for suggestions.
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  
package com.toasted;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.audio.Music;
import com.badlogic.gdx.audio.Sound;
import com.badlogic.gdx.files.FileHandle;

public class Audio {
   public static Sound beep0 = newSound("blip.wav");
   public static Sound swing = newSound("swing.wav");
   public static Sound crumble = newSound("crumble.wav");
   public static Sound laser = newSound("laser.wav");
   public static Sound vaporize = newSound("vaporize.wav");
   public static Sound thump = newSound("thump.ogg");
   public static Sound siren = newSound("siren.ogg");
   public static Sound wood = newSound("wood.ogg");
   public static Sound chain = newSound("chain.ogg");
   
   public static Sound whiteSedan = newSound("whiteSedan.ogg");
   public static Sound cleanUp = newSound("cleanUp.ogg");
   public static Sound carl = newSound("carl.ogg");
   public static Sound thankYou = newSound("thankyou.ogg");
   public static Sound dairy = newSound("dairy.ogg");
   public static Sound special = newSound("special.ogg");
   public static Sound cashews = newSound("cashews.ogg");
   
   public static final float cleanUpRuntime = 2.0F;
   public static final float whiteSedanRuntime = 5.0F;
   public static final float carlRuntime = 7.5F;
   public static final float thankYouRuntime = 7.75F;
   public static final float dairyRuntime = 5.75F;
   public static final float specialRuntime = 7.0F;
   public static final float cashewsRuntime = 6.0F;
         
   public static Music gameLoop = Gdx.audio.newMusic(Gdx.files.internal("sound/musicLoop.ogg"));
   public static Music rageMusic = Gdx.audio.newMusic(Gdx.files.internal("sound/rage.ogg"));
   
   public final static float SWING_VOL = .5F;
   public final static float VOL = 1.0F;
   public static boolean enabled = true;
   
   public void pauseAll(){
      beep0.pause();
      swing.pause();
      crumble.pause();
      laser.pause();
      vaporize.pause();
      thump.pause();
      siren.pause();
      wood.pause();
      whiteSedan.pause();
      cleanUp.pause();
      chain.pause();
     
      gameLoop.pause();
      rageMusic.pause();
   }
   
   public static void play(Sound s){
      if(enabled)
         s.play(VOL);
   }
   public static void loop(Sound s){
      if(enabled)
         s.loop(VOL);
   }
   public static void loop(Sound s, float vol){
      if(enabled)
         s.loop(vol);
   }
   public static void play(Music m){
      if(enabled)
         m.play();
   }

   
   public static void playRandomPitch(Sound sound, float vol){
      if(!enabled) return;
      float pitch = Global.r.nextFloat();
      sound.play(vol, (pitch * 1.0F) + 1.0F, 0);
   }
   
   private static Sound newSound(String filename){
      return Gdx.audio.newSound(Gdx.files.internal("sound/"+filename));
   }
}

And this is where I believe I'm seeing my problem.
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  
for(int i = 0;i < products.size();i++){
         Product p = products.get(i);
         if(p.position.x < player.position.x && player.position.x - p.position.x > 32){
            products.remove(p);
         }
         if(!p.exists()){
            //shatter
           for(int j = 0;j < 5;j++){
               particles.add(new Particle(p.position, new Vec2D(Global.getRandomInt(1, 10), 0), 2.0F, true, Art.frag(p.item)));
            }
            productCounter[p.ID]++;
            products.remove(p);
            Global.score += (int)Global.multiplier * Product.points[p.ID];
            if(p.sliced) {
               rage += 1 * (Global.crown ? 1.5F : 1F);
               Audio.playRandomPitch(Audio.crumble, .25F);
            }else{
               switch(rageType){
               case lazerVision:
                  Audio.play(Audio.vaporize);
                  break;
               }
            }
            if(rage > 100){
               rage = 100;
            }
         }
      }
7  Game Development / Newbie & Debugging Questions / Re: Libgdx sound lag? on: 2014-07-10 18:04:01
Well, yeah I guess it would just be running slowly. There's not any noticable latency between when the sound is supposed to play and when the sound actually plays. Sorry for the misnomer there.
8  Game Development / Newbie & Debugging Questions / Re: Libgdx sound lag? on: 2014-07-10 17:05:05
I just checked the format on that sound, and ironically, it's one a wav. I'll try converting it over to OGG later. Also, I'm not having any performance trouble on PC, only android.
9  Game Development / Newbie & Debugging Questions / Libgdx sound lag? [solved] on: 2014-07-10 15:55:25
I've been working the kinks out of my game that I've been working on ON an OFF for quite some time and now I'm reaching the end. I've noticed that, while the game runs perfectly fine on my POS PC, I am getting lag whenever I play it on android. The point of this game is to destroy products on shelves, and when they are destroyed, they play a crumble sound with a randomized pitch. Something like 5 or 6 products are all destroyed at the same time. At first, I thought this issue was from all the particles I spawn when the products are destroyed, but I quickly learned that when I disabled in-game sound, I had no more lag. I was wondering if anyone else has had this kind of trouble with sound and libgdx. If necessary, I'll post some code later. Thanks in advance.
10  Game Development / Newbie & Debugging Questions / Re: Collision detection with tiling, fall problems? on: 2014-07-10 14:21:19
Currently, you are getting the the collisions based on two different tiles, when your character is only less than one tile wide.
1  
2  
3  
4  
5  
// Find the tile the robot spans.
int t = player.getY1() / BLOCK_SIZE; // Top tile coordinate.
int b = (player.getY2() / BLOCK_SIZE); // Bottom tile coordinate.
int l = player.getX1() / BLOCK_SIZE; // Left tile coordinate.
int r = player.getX2() / BLOCK_SIZE; // Right tile coordinate.


if the width of the player is less that the tile width, I would only check the center of the player with collision with the ground. So maybe add another variable to your tiles to make it:

1  
2  
3  
4  
5  
6  
// Find the tile the robot spans.
int t = player.getY1() / BLOCK_SIZE; // Top tile coordinate.
int b = (player.getY2() / BLOCK_SIZE); // Bottom tile coordinate.
int l = player.getX1() / BLOCK_SIZE; // Left tile coordinate.
int r = player.getX2() / BLOCK_SIZE; // Right tile coordinate.
int m = ((player.getX2() + player.getX1()) / 2 ) /  BLOCK_SIZE; // The NEW middle tile coordinate

And then change your fall code so that it uses that variable instead:
1  
2  
3  
if(!blocks[b][m].isSolid()) { 
   player.fall(1);
}


With these changes, you may see slight overlap of the character on the wall that he just falls over, but he should be able to move out of it. Just looking at your collisions code, it looks like walls will be troublesome for you as you can't quite get very close to them.

Edit: changed a minus to a plus.
11  Game Development / Newbie & Debugging Questions / Re: Should I move to LibGDX? on: 2014-07-07 21:05:08
I highly suggest LibGDX. It's a great library with plenty of features, tools, and documentation. That being said, don't switch engines on the game midway through the project. I've made that mistake before and rewriting everything to use the new graphics APIs is a heavy chore that pretty much requires redoing the entire framework of the logic of your game. Try using LibGDX on your next project, and sticking with Slick to finish the one you're on.
12  Game Development / Game Mechanics / Re: RPG Dialogue Boxes on: 2014-06-13 17:53:20
This is how I handle text wrapping in my Font.java class.
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
public String[] split(String fLine, float maxWidthInPixels, float scale){
      String[] lines = new String[10];
      int lineArrayIndex = 0;
      float curWidth = 0;
      int lastSpaceIndex = 0;
      int startIndex = 0;
      for(int i = 0;i < fLine.length();i++){
         String temp = fLine.substring(i, i + 1);// letter
        if(temp.equals(" ")) lastSpaceIndex = i + 1; // the + 1 accounts for the space, so that the space isn't place at the beginning of the next line.
        curWidth += getLength(temp) * scale;
         
         if(curWidth >= maxWidthInPixels){
            i = lastSpaceIndex;
            lines[lineArrayIndex] = fLine.substring(startIndex, lastSpaceIndex);
            startIndex = lastSpaceIndex;
            curWidth = 0;
            lineArrayIndex ++;
           
         }
      }
      lines[lineArrayIndex] = fLine.substring(startIndex, fLine.length());
      return lines;
   }
13  Discussions / Miscellaneous Topics / Re: What do you develop your games on? on: 2014-05-11 03:48:11
I'm working with my 2009 Dell 15" Inspiron Laptop.
Specs:
Windows 7 Home Premium
2.1Ghz Intel Core 2 Duo
4Gb RAM
320Gb 5400rpm HDD
and the crappiest graphics man can create.
14  Java Game APIs & Engines / Engines, Libraries and Tools / Re: libdgx 3d Texture Issues on: 2014-04-18 00:32:12
Image hosting changed to imgur. You should be able to see them now. Sorry about that.
15  Java Game APIs & Engines / Engines, Libraries and Tools / libdgx 3d Texture Issues on: 2014-04-18 00:21:48
I'm trying to get myself started on 3d with libgdx. However, my textures seem to be giving me some problems. I have the model all textured and done in blender as shown:

But when I load it into libgdx, I come up with this:


If anyone has some insight as to what I might be doing wrong, that would be great.
Also, if you want to read the code I'm using, I'm following Xoppa's tutorial as shown here:
http://blog.xoppa.com/loading-models-using-libgdx/
16  Game Development / Game Mechanics / Re: Passing a variable vs. Storing that variable on: 2014-02-14 04:38:49
Ok, thanks. I was only citing Notch's code because it was one example that I could think of.
17  Game Development / Game Mechanics / Passing a variable vs. Storing that variable on: 2014-02-14 03:03:44
Just as a general question I was wondering which method would be the best practice. Passing the variable containing the game world in the update function during every update of an entity, or, upon creation of the entity, store it as a variable in the entity class. I've used the second method before and it worked just fine. If I recall correctly minecraft uses the former of the two. What is your opinion on which is better?
18  Game Development / Newbie & Debugging Questions / the left hand side of the assignment must be a variable? on: 2013-09-16 04:17:42
I'm having a bit of trouble with one function in my problem and it's giving me the answer that I've put as the title. I'm pretty dang sure I haven't done anything wrong, but it's still throwing the error.
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
public class Line {
   public Vec2D p1, p2;
   public Line(Vec2D p1, Vec2D p2){
      this.p1 = p1;
      this.p2 = p2;
   }
   public boolean intersects(Line l){
      if( ( ((p1.x - p2.x)(l.p1.y - l.p2.y)) - ((p1.y + p2.y)(l.p1.x - l.p2.x)) ) == 0) return false; // here's where the error is
     return true;
   }
}

Any ideas?

EDIT: wow I feel stupid. I've been in calc class too long and forgot to put the * symbols in.. DISREGARD THIS THREAD
19  Game Development / Newbie & Debugging Questions / Re: Need advice regarding java libriaries on: 2013-09-14 14:24:06
For my first games, I've been using Java's built in library, Java2d. It works perfectly fine for most of the stuff I do. It's just not terribly efficient though.
20  Games Center / WIP games, tools & toy projects / Re: Eclipse - Moon Base Simulator on: 2013-09-08 21:38:01
I'll think about reorganizing some of the UI, anything in this can be subject to change.

As for the Jar, when i export the project from the IDE (Eclipse), i just select Runnable Jar.
21  Games Center / WIP games, tools & toy projects / Re: Eclipse - Moon Base Simulator on: 2013-09-08 19:34:25
Thanks for the feedback. When you say that you have to open the menu to access the buttons, do you mean the construction menu? Or do you mean just the menus in general? I tend to think of the goal sort of like a Dwarf Fortress idea where the goal is to survive. I do plan on implementing a tutorial section that explains what everything does. I'll start working on that ASAP for anyone who tries it.
22  Games Center / WIP games, tools & toy projects / Re: Eclipse - Moon Base Simulator on: 2013-09-05 22:21:47
One of my favorite features as of yet is the economy system. You can watch the trade prices of materials and any traders will base their trade price on the market price.
23  Games Center / WIP games, tools & toy projects / Re: Eclipse - Moon Base Simulator on: 2013-09-05 01:08:07
Sorry about that. Here's a couple of pics in game, I really need to add a way to make it take screenshots and save them.
This is the construction menu, where you'll find all the available buildings that can be made, along with all specifications as to them.

This is the Crew management system. You can view information about crew and view applicants that wish to join your crew.
24  Games Center / WIP games, tools & toy projects / Eclipse - Moon Base Simulator on: 2013-09-04 23:20:48
My latest project is a little something called Eclipse. And yes, the IDE gave me the idea for the name. Anyway, in this game, you manage and build your own moon base. From managing crew, to mining the moon's surface for ore to trade or smelt, there are lots of features planned for this. It's been in development since late July and I thought that it was about time to show off my progress.
Any comments or criticisms are greatly appreciated.

Download it here! FYI it's about a 21mb file.
https://www.dropbox.com/s/bszt2sau5mz6czp/build10.jar
25  Discussions / General Discussions / Re: What You Do When You are Burnt Out on: 2013-08-17 04:32:51
Reddit, TF2, or maybe even do something I'm actually supposed to be doing...
26  Game Development / Newbie & Debugging Questions / Re: Having an issue loading text files on: 2013-08-15 21:00:12
OK, I've got it now. I've got it just how you set it up, jonjava. Also, I had no idea that the string for the name was case sensitive. You people have been a huge help. Thanks so much.
27  Game Development / Newbie & Debugging Questions / Re: Having an issue loading text files on: 2013-08-15 20:37:08
Now, quick question, with the res folder in the build path, shouldn't it automatically take everything from the res folder and drop it into the bin folder?

Yes. There's no need to put everything inside the src folder. There's a problem somewhere else. Lemme hack an example program for some "working" code.
Okay, i tried deleting all the images and .src files from the bin folder and when i went to run it, it didn't automatically put them back.
28  Game Development / Newbie & Debugging Questions / Re: Having an issue loading text files on: 2013-08-15 20:32:25
Now, quick question, with the res folder in the build path, shouldn't it automatically take everything from the res folder and drop it into the bin folder?
29  Game Development / Newbie & Debugging Questions / Re: Having an issue loading text files on: 2013-08-15 19:11:13
I did as you said, and both worked perfectly in the workspace, but STILL not when i export. I double checked that the files made it into the jar as well.
30  Game Development / Newbie & Debugging Questions / Re: Having an issue loading text files on: 2013-08-15 18:59:59
Ok, so I changed it to:
1  
return Assets.class.getResourceAsStream("/" + name);

and that works fine and dandy in eclipse, but still throws a null pointer when run from a jar.
Pages: [1] 2 3 ... 7
 

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

The first screenshot will be displayed as a thumbnail.

Riven (18 views)
2014-07-29 18:09:19

Riven (13 views)
2014-07-29 18:08:52

Dwinin (12 views)
2014-07-29 10:59:34

E.R. Fleming (31 views)
2014-07-29 03:07:13

E.R. Fleming (12 views)
2014-07-29 03:06:25

pw (42 views)
2014-07-24 01:59:36

Riven (41 views)
2014-07-23 21:16:32

Riven (28 views)
2014-07-23 21:07:15

Riven (29 views)
2014-07-23 20:56:16

ctomni231 (60 views)
2014-07-18 06:55:21
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
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!