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
1  Games Center / Showcase / Re: Hunger Games Board Game on: 2012-12-05 20:18:15
@packet Usually you can get right into making games in a year with a good teacher, because all those days that is spent googling/thinking over a problem a teacher can bring you right up-to-date

@OP Could you wrap the change log in code tags or something similar that can be hidden?
2  Games Center / Archived Projects / Re: Castle Forge on: 2012-12-05 20:10:39
1  
2  
3  
4  
5  
6  
java -version
java version "1.7.0_03"
Java(TM) SE Runtime Environment (build 1.7.0_03-b05)
Java HotSpot(TM) 64-Bit Server VM (build 22.1-b02, mixe
java -jar CastleForge-1.0.jar
Error: Invalid or corrupt jarfile CastleForge-1.0.jar
3  Discussions / General Discussions / Re: Just saying I JUST FINISHED SCHOOL on: 2012-10-23 17:28:36
Great work! Now you have to spend ~50 years working, and then you can relax.
4  Games Center / WIP games, tools & toy projects / Re: Targets on: 2012-10-10 23:28:40
Much better! I can actually kill stuff now =) [How do you reload btw?] However, you should consider using delta time, in slicks update method it would look like:

1  
2  
3  
update#delta
  for each entity
    entity life remaining -= delta
5  Games Center / WIP games, tools & toy projects / Re: Targets on: 2012-10-10 18:42:22
You should not be using a timer based on the fps in the first place.

java.util.Timer
javax.swing.Timer / java.awt.Timer [For java2d]


your own implementation of Timer
Using delta time [Preferred]
6  Games Center / WIP games, tools & toy projects / Re: Targets on: 2012-10-10 18:27:35
I assure you I am not getting any two seconds.

Actually I just figured it out, when I fraps it (Which auto-locks framerate) I get MUCH longer, but without fraps I get between 3k and 5k fps and barely even see the objects.

Your logic depends of FPS, which means on my fairly fast computer I get entirely different gameplay then on a slower computer. [Also I can tell fraps to lock it at 1 fps and win =D]
7  Discussions / Business and Project Management Discussions / Re: Island Forge Kickstarter Success - Now Free-to-Play! on: 2012-10-09 22:31:42
Great work! Wish I could play without breaking the TOS, not 18 and my friends are EU =(
Quote
To establish an Account, you must be a resident of the United States and at least 18 years old
8  Games Center / WIP games, tools & toy projects / Re: Targets on: 2012-10-09 22:10:51
How do you kill them so fast? I can't even click one because they disappear in ~0.5 seconds =(
9  Game Development / Newbie & Debugging Questions / Re: Need platform game tutorial or working code example on: 2012-10-09 20:28:00
Wow, thats not exactly specific... at all.  I am assuming you are using Slick2D (based on the tutorial names you mentioned), so this is what I have used and wish someone told me when I started.

You don't need any direct OpenGL calls, if you do use a different library.
Animation class works just like the image class and can be replaced later.  Use the Animation class 99% of the time unless you are certain you won't ever need to add an animation - the performance cost on a side-scroller is negligible.

Running a platform, use velocities, don't bother with fancy timers for jumps, because you will replace it later.  Here's an example of what it might look like in the update method. For the full sourcecode of my platformer that you can play around with, look at http://www.java-gaming.org/topics/2d-shooter-difficulty/27419/view.html. This includes some basic AI, although extremely basic. [I used an AStar algorithm, ironically, for my pacman game.]

If your IDE supports it, make the background for hard-coded number REALLY UGLY. EG In eclipse Window -> Preferences -> Java -> Editor -> Syntax Coloring -> Numbers -> Red + Underlined + Italics. You should only see this color in constant static fields.

Besides those tips, don't get frustrated and avoid restarting.  And don't try to make it multiplayer until you are certain you have singleplayer games down and have competed in a few 48 hour competitions (these will really push your game understanding)

10  Game Development / Newbie & Debugging Questions / Re: 2D Graphics Other Than Java2D on: 2012-10-09 20:06:22
I wouldn't say Slicks codebase is "disastrous", more like it's trying to copy Java2D, although I have avoided the classes that attempt to save / load for you [Oh dear, D=]

I really like having my draw method look like
1  
animation.draw(x, y);

and it will tick it at the right speed and smoothes automatically (I believe). Also really like that it has a default font, because I'm terrible at drawing something even that simple.
11  Game Development / Game Play & Game Design / Re: Designing a gardening simulation on: 2012-10-08 19:19:57
Since you are making a game for aesthetics, and especially because you want a sandbox version, use what minecraft did best. Do not package the art in the jar.  Texture packs will do more to boost fan creativity of anything short of actual modding!
12  Game Development / Newbie & Debugging Questions / Re: Why is getting a LWJGL applet to display in the browser utter hell!? on: 2012-10-06 02:10:53
This might be helpful, I don't know:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
basic: Applet initialized
basic: Starting applet
basic: completed perf rollup
basic: Applet made visible
basic: Applet started
basic: Told clients applet is started
Fri Oct 05 17:12:02 PDT 2012 INFO:Slick Build #239
ATTEMPTING METHOD 1
METHOD 1 SUCCESSFUL
Fri Oct 05 17:12:03 PDT 2012 INFO:Starting display 500x300
Fri Oct 05 17:12:03 PDT 2012 INFO:Controllers not available
13  Game Development / Newbie & Debugging Questions / Re: Why is getting a LWJGL applet to display in the browser utter hell!? on: 2012-10-06 01:54:09
Works fine for me.

EDIT:
Windows 7, AMD Phenom II X4 975 Processor 3.61 GHz
8.00 Gigs of Ram
64-bit
 
1  
2  
3  
java version "1.7.0_03"
Java(TM) SE Runtime Environment (build 1.7.0_03-b05)
Java HotSpot(TM) 64-Bit Server VM (build 22.1-b02, mixed mode)
14  Games Center / WIP games, tools & toy projects / Re: Just Tactics - multiplayer turn-based strategy/deckbuilding on: 2012-10-05 20:47:54
The website is... less than impressive. Will edit when I play the game, it's downloading.

Edit: It just waits on MatchMaking.. presumably because there is nobody else on the server. No singleplayer? =(
15  Game Development / Shared Code / Server Console Cross-post on: 2012-10-02 21:59:41

Sort of a cross-post from this, except oriented towards a server. Code has the same base, maybe more up to date.

Hi, lets not reinvent the wheel here when it comes to making a simple gui for Servers, especially when it is independent from the client (Not uncommon).  It would be simplest if one could just tell the computer "use swing instead of console", and then "if any of these are said, do xyz, otherwise do abc".  This is just that, except with two different levels.  The lower level acts as close to System.out and a Scanner wrapping as is possible, and is shown in this pastebin.

The relevant code of the sort of things you could do with this 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  
/**
   * For testing purposes, shows an example usage of this program
   */

  public static void main(String[] args)
  {
    ConsoleGUI.toGUI();
    ConsoleGUI.setSaveText(true);
    TAScanner scanner = ConsoleGUI.getScanner();
    TAPrintStream out = ConsoleGUI.getStream();
    out.println("Type a string");
    String str = scanner.nextLine();
    out.println("Type an int");
    int i = scanner.nextInt();
    out.println("You typed "+str+" and "+i);
    out.println("Say something starting with y");
    boolean b = scanner.nextBoolean();
    out.println(b);
    out.println("Say something starting with n");
    b = scanner.nextBoolean("n", true);
    out.println(b);
    out.println("Say banana");
    b = scanner.nextBoolean("banana", false);
    out.println(b);
   
    out.println();
    RuntimeException exc = new RuntimeException();
    handleException("Test", exc, saveRun);
    //for(int i = 0; i < 50; i++) { out.println("Purposeful Spam"); }
 }


This has methods from ints to doubles, although throws exceptions if you ask for an int and get "asdf".  Intuitive and consistent, makes a console-based ASCII game easily converted into an executable jar, but besides that doesn't seem like anything special.  The sub-class however, will make the 'gui' part of your code be able to cleanly and nicely fit inside one class or several anonymous classes.  That way, you can do more fun stuff, like that network code you "forgot" to do. Pastebin

This would let you do something like
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
public static void main(String[] args) {
  CommandListener listener = new CommandListener() {
    @Override
    public void onCommand(String nm, String[] params) {
      if(nm.equalsIgnoreCase("eatanapple") {
        String aniName = params[0];
        ConsoleGUI.getStream().println(aniName + " ate an apple!");
      }else if(..) {
        ...
      }
    }
  };
  ServerConsole.getGUI().registerCommand("eatanapple",
                                         "Makes an animal eat an apple. Example: eatanapple Bob", listener);
  ServerConsole.updateHelp(); // Called when you finish registering commands.
}

A few 'special' commands that it will have by default include:
default - If an unknown command is entered, same as help if not overriden
help - prints the list of commands. updateHelp() MUST be called after all registerCommands(..) to be up-to-date
memory - prints memory usage.

This is what typing memory might look like:
1  
2  
3  
4  
5  
> memory
Allocated Memory / Max Memory: 259,522,560 (247.5 megabytes)
Total Memory: 16,318,464 (15.56 megabytes)
Free Memory: 11,736,760 (11.19 megabytes)
Used Memory: 4,581,704 (4.37 megabytes)
16  Games Center / Showcase / Re: Old School 2D RPG with twists... on: 2012-10-01 23:04:06
300 megabytes.. that's to much for me to download without it being AAA, sorry.  Also, you need some more bigger screenies!
17  Game Development / Newbie & Debugging Questions / Re: Tiled Map Level Editor Problem on: 2012-09-28 23:00:37
http://stackoverflow.com/questions/7298817/making-image-scrollable-in-jframe-contentpane

That should sum it up, top answer
18  Game Development / Newbie & Debugging Questions / Re: Tiled Map Level Editor Problem on: 2012-09-28 21:46:44
I tried that so many times and it didnt work, but for some reason when you posted it, i tried again and saw the light, i was adding the JScrollPane in the class that extended JPAnel, rather than doing it in my class that extends JFrame.

THANKS!

Summary: Wrap the JFrame, not the JPanel
19  Game Development / Newbie & Debugging Questions / Re: Delayed rotation on: 2012-09-27 18:17:23
Note I am not talking about experience here - have yet to succesfully build a game that lets you change angles =(

However, I do know a little bit about interpolation and extrapolation, which you probably need to former here if my knowledge is correct, or a form of it at least.

Save those variables as currentX, currentY and have it move some percent or absolute amount max at a time toward the current x/y and you have done it. Note that if this is an FPS of some sort or requires 'twitch' responses, this should be configurable, because it will give the user a different response then what he does, which will annoy them if it's twitch.

Here's some 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  
protected static final float MAX_X_CHANGE = 10; // Random number
protected static final float MAX_Y_CHANGE = 10; // will need testing

protected float currentDesiredX;
protected float currentDesiredY;

protected float actualX;
protected float actualY;

protected void interpolateDirection() {
  float diffX = currentDesiredX - actualX;
  float diffY = currentDesiredY - actualY;
  if(Math.abs(diffX) <= MAX_X_CHANGE) {
    actualX = currentDesiredX;
  }else {
    actualX += Math.signum(diffX) * MAX_X_CHANGE;
  }
 
  if(Math.abs(diffY) <= MAX_Y_CHANGE) {
    actualY = currentDesiredY;
  }else {
    actualY += Math.signum(diffY) * MAX_Y_CHANGE;
  }
}


EDIT - noticed it's just rotation, in which you can just modify the code appropriately. The variable names can be improved =P
20  Game Development / Newbie & Debugging Questions / Re: What "technique" is Notch using? on: 2012-09-27 17:56:34
I think the reason he does it that way is because he probably needed something like that for his earlier games and got really good at it, so he finds it easiest to use that system and it does have a few benefits. (Can make textures a little bit more random if he wanted to, etc)

Really, it's just whatever works for you imho.
21  Games Center / WIP games, tools & toy projects / Re: Auctus[0.1] on: 2012-09-26 16:34:36
Of course, nothing to be ashamed of, it's 1million times better than the average computer user has ever done =)
22  Games Center / WIP games, tools & toy projects / Re: Auctus[0.1] on: 2012-09-26 00:19:25
A heads up before I play - your download link has several typos.

Ok played [and lost] the game, and to make this game 1000x better, change
1  
numberOfEnemies = 500
to like
1  
numberOfEnemies = 5
, or better yet, remove that variable entirely.  Change the win condition to a particular size, which is greater than or equal to the maximum size of the enemies, and include spawning code. On a side note, your enemies should be a List, not an array. 

Here is an example of what I would expect your spawn code to 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  
private static final float SPAWN_CHANCE = 0.01f;
private static final int MAX_ENEMIES = 25; // or something
private static final int WIDTH = 640; // or whatever it is
private static final int HEIGHT = 480; // again, the actual number
private static final int MAX_SIZE = 25; // whatever your max size is

private Random gen;

...

private void spawn() {
  if(enemies.size() < MAX_ENEMIES && gen.nextFloat() < SPAWN_CHANCE) {
     float x = gen.nextFloat() * WIDTH;
     float y = gen.nextFloat() * HEIGHT;
     float xVel = (gen.nextFloat() + 1) * 3; // this can be changed of course
    float yVel = (gen.nextFloat() + 1) * 3; // again, can be changed
    float size = gen.nextInt(MAX_SIZE); // no idea what you use
    enemies.add(new Enemy(world, x, y, xVel, yVel, size)); // Or whatever your constructor is, but this is what I would expect
 }
}

..

private boolean checkIfWin() {
  return player.getSize() >= MAX_SIZE;
}


Another thing I noticed, you generally want to avoid polling input in the same spot you move, make an update method (Or use slicks one) and do it there.  When polling input, set the velocity of the character.  This also allows for neat effects like you speed up to the max velocity and slow down to zero, or making it take a moment to change directions.  Being a square I'd imagine it takes a bit to get moving.

Also with this kind of spawning, you can make it fancy and have it make less and less small squares as you get bigger, and less huge ones when you are tiny.


http://goo.gl/tqMKo is the correct link, I believe
23  Games Center / Showcase / 2D Shooter - Difficulty: <RageQuit /> on: 2012-09-25 20:35:47


Hello, I made a fun little 2D shooter quick response game.  The levels start out quite easy - how to move - to near impossible.  Currently there are 9 complete levels and 10 tutorial levels, which are interspersed appropriately.  What I think to be an exciting / interesting part of the game is the level saving system which allows for hand crafting your own levels, and I purposely had it reload from file on hitting 'r', or dieing, for easier testing of levels. For more info on the level editing, go here.

An example level is below. This is level 2, just like the screenshot
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
weapon bow
name = levels/level2.txt
writing = center 300 Level 2 - The Swarm
writing = right bottom -->

mob = 350 bottom swordplayer
mob = 400 bottom swordplayer
mob = 450 bottom swordplayer
mob = 500 bottom swordplayer
mob = 550 bottom swordplayer

next = levels/swordtutorial.txt


Besides that, here is the download link in huge letters.  Have fun, post if you beat it! I might add a death counter, but that might make even me angry.

[size=16pt]Download[/size][/b]
24  Games Center / Archived Projects / Re: retro style RPG - CONCEPT on: 2012-09-16 02:55:02
Looks like a great idea! Created a vimeo account just to follow it, will be extremely interested in how you plan on networking this, and would love to see regular source posts!  I would willing to help out it you need anything. Not good at art though D=]  I would strongly encourage something like github though!
25  Games Center / Archived Projects / Re: [Coming on Android] Rising Empires on: 2012-09-16 02:50:59
Interesting! What kind of payment scheme are you planning on? [Pay to play, Pay for certain races, free to play + ads and pay to play without]  As a note, the one kind of payment scheme I'm a sucker for is pay for bonus races!
26  Java Game APIs & Engines / Tools Discussion / Re: Some reasonable output from my generative music system on: 2012-09-04 21:37:16
Ahh, my apologies then.  I saw the name and assumed it was it.
27  Java Game APIs & Engines / Tools Discussion / Re: Some reasonable output from my generative music system on: 2012-09-04 18:14:44
Wow, this is incredible! By any chance will you be posting a download link for the executable? This would certainly spice up my games, and I would think pretty much any game. Just from clicking a few of the links, this is nearly as good as better than some music that was custom made.

EDIT: Found the link commented out on your websites main page. http://www.springworldgames.com/musicgenerator/
TL;DR Very impressive
28  Game Development / Newbie & Debugging Questions / Re: Slick2D game not running on all computers... on: 2012-08-21 00:40:44
The only way this problem could occur, according to my Google searches are:
  • Didn't call Display.create() -> Can be ruled out because it worked on your system
  • A OpenGL call on a different thread -> This would be possible to happen on your friends system if it had a different priority by default or a different java implementation, but since you already stated you don't use multithreading (which you should for loading resources) that can be ruled out
  • Your friend doesn't have a graphics card that supports Open GL 1.1 -> Already mentioned, and the only reasonable answer I can think of
29  Game Development / Newbie & Debugging Questions / Re: I am looking for some help. on: 2012-08-21 00:25:07
Most of what you are saying is not as 'basic' as you are implying.  However, some moving and network code (network isn't finished) can be seen at my project, which is completely open source, although the source is up on github and right now isn't a full build (In development), but you can look at the earlier commits that don't have any networking code. Note this is all in Slick2D.  It's pacman, not even completed at that, and it currently has 5 packages and 49 classes, and isn't as abstract as I want.  This doesn't include
A: Animations
B: Scrolling
C: Most of the networking
Although, to be fair, it does have an A* algorithm for the AI.

Snippets
AbstractGameMode#doTick(long)
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
gameTime += delta;
      doMovement(player1, player1Modifier);
      doMovement(player2, player2Modifier);
     
      Rectangle2D.Float pla1 = player1.getLocationAsRect();
      Rectangle2D.Float pla2 = player2.getLocationAsRect();
     
      if(pla1.intersects(pla2))
         onPlayerCollide(time);
     
      checkEntityCollisions(time);


30  Discussions / Community & Volunteer Projects / Re: [Wanted] Developers, Pixel Artists and Bgfxr on: 2012-08-19 22:26:44
Summer is almost over; once school starts I'll be able to commit a lot more.
Sentences I never thought I would here
Pages: [1] 2
 

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

The first screenshot will be displayed as a thumbnail.

CogWheelz (12 views)
2014-07-30 21:08:39

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

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

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

E.R. Fleming (32 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 (42 views)
2014-07-23 21:16:32

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

Riven (30 views)
2014-07-23 20:56:16
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!