Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (701)
Games in Android Showcase (203)
games submitted by our members
Games in WIP (774)
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 ... 37
1  Java Game APIs & Engines / Engines, Libraries and Tools / Re: Libgdx notable game repositories on: 2016-11-09 16:27:09
You might try searching game jams like Ludum Dare for libGDX games. Many of those are open-source.
2  Game Development / Newbie & Debugging Questions / Re: Creating a Button. on: 2016-11-09 13:22:12
Above is the working code (apart from the parts I can't test) , for the creation of a button that is drawn using  (g.drawImage(but.getSprite(), but.getX(), but.getY(), null)Wink  in a different class.

In the future, you might have better luck if you post an [MCVE](http://stackoverflow.com/help/mcve) that includes a main method and all the code we need to copy and paste it to run ourselves.

Above is the working code (apart from the parts I can't test) , for the creation of a button that is drawn using  (g.drawImage(but.getSprite(), but.getX(), but.getY(), null)Wink  in a different class.

The issue I'm having is setting an area for MouseListener to activate. To what I have read, for MouseListener to work, I need to have a JComponent attached to my Button class. Do I need to put something like a JLabel onto my class to give my button mouse input or is there a better way?

If you're going to use a Swing component like JLabel, why not just use a JButton instead of your own custom class?

How you do this depends on how you're drawing your button. If you're using a Swing component like JLabel or JButton to draw your button, then you'd just add the listener to that. JButton even has its own ActionListener that you can use instead of handling all the mouse events yourself.

But if you're manually drawing the button yourself, then the MouseListener needs to be on the component doing the drawing. For example if you're extending JPanel and overriding the paintComponent() function, then the MouseListener would go on that class.
3  Game Development / Newbie & Debugging Questions / Re: Multi thread Memory Visibility inside Synchronized keyword on: 2016-11-04 14:31:56
Synchronization has nothing to do with visibility.

The only thing your synchronized methods guarantee is that they can't be called by two different threads at the same time.

You aren't even using threads, so this is a non-issue.

By the way, a rhetorical question is a question that you don't expect an answer to. Maybe you meant hypothetical question?
4  Game Development / Game Mechanics / Re: What are the ways to render a 2d game? on: 2016-11-03 14:25:21
Can you please list down the ways 2d java game programmers do to render images for their games? What are the recommended way by Oracle? What are their pros and cons? There are just so many ways to implement this (rendering an image)! Can someone please enlighten me?

That's the thing about programming: there is never a single best way to do anything. There are always a million ways to do any one thing, and each approach has its own pros and cons. Many of those pros and cons depend on you more than anything. How you think, what you prioritize, what you've learned so far, etc.

So asking us to list every single way and all of their pros and cons is a little bit like asking us what you should eat for dinner. We can tell you what we eat for dinner, but that might not be what you should eat. The only way to figure out what is best for you is to try a million different things out and see what you like and don't like.

I will say that I personally love Processing, especially for novices.
5  Java Game APIs & Engines / Engines, Libraries and Tools / Re: Generic Multiplayer Connector on: 2016-11-02 13:05:40
Now that it's multiplayer, that's all I need.

To be honest, I probably spent less than 10 seconds thinking about the maze generation.  Your game generates random mazes which is all I needed to create a nice simple game I can play against my kids.

Fair enough. Enjoy!

But you might want to play a few rounds against yourself and then use those likelihoods instead of the default, that way the mazes are actually interesting. Up to you!
6  Java Game APIs & Engines / Engines, Libraries and Tools / Re: Generic Multiplayer Connector on: 2016-11-01 13:17:17
The game sends the maze data to the other players, so they have the same mazes.

I understand that part. I wasn't talking about your multiplayer version, I was talking about the generator itself. I'm trying to say that the seed has nothing to do with the difficulty of the maze, and it's all based on player performance. Your current multiplayer version will just end up with random (and probably pretty easy) mazes without any notion of difficulty.
7  Java Game APIs & Engines / Engines, Libraries and Tools / Re: Generic Multiplayer Connector on: 2016-10-31 17:41:00
Regarding the maze complication, I think I just increased the seed that your function used, which I assumed made it harder.

Sorry, but this is not at all how it works. The maze generator is defined by a few likelihoods: likelihood that the path goes forward, likelihood that the path goes left or right, etc. There is no concept of harder or easier or more or less complicated in the generator itself. Instead, the generator uses how long the human players take to solve a maze to find the "hardest" maze and then uses that maze as the parent for the next generation.

Think of it this way: each "round" of the game is actually 3 mazes: one was generated with more likelihood for straight paths, one was generated with more likelihood for left paths, and one was generated with more likelihood for right paths. At the end of the round, the generator takes the maze that took you the longest to solve and uses that as the parent of the next generation, so subsequent mazes will be generated with similar (but still mutated) likelihoods.

After a few rounds of that, the mazes naturally evolve to be more complicated, but it's not based on any idea of complication in the code itself. It's based entirely on player performance, and in fact two players might get completely different types of mazes based on how they perform.

You could use the generator to evolve mazes based on both player performances (evolve mazes that would be easier for the loser? or more complicated for the winner?), but it's not as simple as modifying a seed value. That doesn't actually change anything other than the initial seed value used by the random generator.
8  Game Development / Newbie & Debugging Questions / Re: Texture Farm on: 2016-10-28 14:29:09
No problem. I'd be curious to hear about what you come up with.
9  Game Development / Newbie & Debugging Questions / Re: Texture Farm on: 2016-10-28 13:57:01
Well, you either need to pass it into the object as an argument, or you need to make it available statically.

But we're talking about two different things here: there's the overall "texture farm" that holds the texture ids and the images they map to, and then there's the individual ids for each object to tell it which texture to use.
10  Game Development / Newbie & Debugging Questions / Re: Texture Farm on: 2016-10-28 13:46:12
I'm not sure I follow. How do you expect the object to know which texture to use?
11  Game Development / Newbie & Debugging Questions / Re: Texture Farm on: 2016-10-28 13:29:05
Sure, anything is possible. It really depends on exactly what you want to do.

You could use a Map<Integer, Texture> that maps from id keys to Texture (or whatever class represents a texture) values.

Or you could use an enum that represents you textures, or objects, or... there are a million different ways to do this.

What have you tried so far? What exactly are you confused about? Where did you get stuck?
12  Java Game APIs & Engines / Engines, Libraries and Tools / Re: Generic Multiplayer Connector on: 2016-10-25 12:55:42
Maybe it should handicap the winner or something?

Yeah that's what I was thinking. Although I like the idea of putting them in the same maze. Would it be possible to drop them into the same maze so they see each other? I don't know if that would work with the kind of mazes it generates though, since there's only really one main path.

I'd also be curious to hear about how you had it generate more or less complicated mazes. The generator is a little blind to that, using how long it takes you to solve previous mazes to make more complicated mazes. In other words it doesn't come from the programmer, it comes from the player. I'd be curious to hear how you programmed around that.
13  Java Game APIs & Engines / Engines, Libraries and Tools / Re: Generic Multiplayer Connector on: 2016-10-24 13:54:43
Here's next project to retro-fit a game into multiplayer using GMC, this time MazEvolution written by KevinWorkman.  It's a maze game where each player gets the same maze, and the first to get to the exit wins.  And then everyone gets a new maze.

This is really cool to see. Wouldn't it make more sense to have the winner get a more complicated maze though?
14  Discussions / Suggestions / Re: Featured Open-Source on: 2016-10-20 14:43:46
I don't disagree with your desire to see more open-source Java games (that's part of why I started Static Void Games in the first place), but I also think you're overestimating the manpower we have here. The forum is run by one person, and we have a dedicated but pretty small user base. The stuff you're proposing takes time and interest. You could start by creating your own list, maintaining a thread of open source games you find, but that probably seems like a lot of work. If it seems like a lot of work for you, imagine how much work it feels like to other people who don't have as much of an interest as you do.

I actually like your idea, I just don't think it's going to get much traction.

If you're looking for open-source Java games, you might check out Ludum Dare, which is a game programming competition where entrants have to release their source. Do a search for Java and you'll get a ton of results. But please note that open-source does not mean no copyrights, so make sure you contact anybody before using their source.
15  Discussions / Suggestions / Re: Featured Open-Source on: 2016-10-20 14:24:27
finding something decent can be a challenge

Yep, exactly. To create this featured board, we (read: Riven) would have to somehow find these gems. It's a bit of a chicken and the egg problem.

You could help jumpstart this by coming up with your own list, but like you said, that isn't as easy as it sounds.
16  Discussions / Miscellaneous Topics / Re: Looking for simple but complete open-source game on: 2016-10-19 15:57:39
I haven't touched this code in years, but I can try to look when I get home.

But this is exactly what's going to make your approach difficult: it's one thing to try to write code and then add multiplayer to it. It's a completely different beast to try to wrap your brain around code written by other people. Even if the code works exactly like you expect (which it never will), you're still going to have to be comfortable going through code written by other people, which can be a very messy experience.

I would guess that what I did was comment out some stuff in order to create some screenshots of mazes without showing the player or exit, but that's really just a guess.
17  Discussions / Miscellaneous Topics / Re: Looking for simple but complete open-source game on: 2016-10-19 15:08:58
You can use Processing as a Java library and use plain old Java with them.

But if I remember correctly, these are all plain Java:

http://staticvoidgames.com/games/Defuse
http://staticvoidgames.com/games/MazEvolution
http://staticvoidgames.com/games/TimeForWords
http://staticvoidgames.com/games/Quidditch
http://staticvoidgames.com/games/BrinyDepths
18  Discussions / Miscellaneous Topics / Re: Looking for simple but complete open-source game on: 2016-10-19 14:47:11
Ah, interesting. I'll be curious to see what you end up doing with this, so keep me updated!
19  Discussions / Miscellaneous Topics / Re: Looking for simple but complete open-source game on: 2016-10-19 13:36:45
I've got a few little open-source games available here: http://staticvoidgames.com/members/Kevin

This one is a puzzle game that might be pretty reasonable to make multiplayer: http://staticvoidgames.com/games/BlackSheep

But like others have said, what you're describing is not trivial. It might sound easier to take an existing game and make it multiplayer, but that's going to be much, much, much more difficult than writing your own game from scratch.

Start very small. Start with the bare basics. Maybe a chat room, or a multiplayer drawing application. Then move onto implementing a simple game, like tic-tac-toe or even rock-paper-scissors. Move on from there in small steps.
20  Game Development / Newbie & Debugging Questions / Re: [SWING] halving the screen with two seperate panes? on: 2016-10-17 12:38:59
Can you please post an MCVE that we can copy and paste to run on our own computers?
21  Discussions / Miscellaneous Topics / Re: AGB Programming on: 2016-10-12 17:50:40
One of the questions that I want to bring up is how come AGB can make fantastic games, such as pokemon, but the modern games we have today, which are 2D, have performance issues? (Keep in mind the AGB isn't the most powerful thing)

Poorly programmed games (or, games that chose to prioritize other stuff) have performance issues. Well-programmed games (or, games that prioritized performance) have better performance.

You seem to be saying that every game for the GBA outperforms every modern game, which is simply not true. There were plenty of poorly written games for the GBA, and there are plenty of well-written games today. That plus modern hardware means that we're doing stuff today that would be physically impossible on the GBA.

It's a bit like the people who say that today's music is terrible compared to music from [insert decade here]. A lot of that is selection bias, because you don't remember the 95% of songs that were terrible from your favorite decade, and you're ignoring the good songs from today. You're comparing one of the most famous games of all time to games that you see on Steam, which isn't exactly an apples to apples comparison.

By the last paragraph, I want to ask, how far have we abstracted? Along with this, in terms of shading, do we really need all the power we have today to represent our stuff?

Sure, one of the "problems" is that we have so much more available at our fingertips. Want a particle system in your game? That's a one-liner. Want physics? Here's Box2D. Want lighting? Here you go. So it can be easy for developers to shove a bunch of stuff that they might not need into a game, without worrying too much about performance or the hardware they're running on. They might design it for their $5,000 hardcore gaming PC, and you'll have issues running it on your 5-year-old Android phone.

But I would argue that's a good thing for the most part. As a developer, I don't want to have to worry about which hardware I'm running on, and I don't care about all the hardware-specific hacks that I could take advantage of if I limited myself like that. I also don't want to reinvent the wheel every time I sit down at the computer, so all these libraries and frameworks are great for me.

That being said, there is a big community around developing games for retro systems. It sounds like you've taken an interest in that, and that's great. Have fun with it. But it's certainly not as simple as saying that the GBA is better at games than modern hardware and software.
22  Game Development / Newbie & Debugging Questions / Re: Should the same objects be made in the same class? on: 2016-09-29 15:15:47
1  
2  
3  
4  
5  
6  
7  
public class BadGuy {
    public BadGuy(){
        badGuy1 = new BadGuy();
        badGuy2 = new BadGuy();
     }

}


Did you actually try that? Try putting together a little example program. You'll see that this code causes a StackOverflowException.

As opposed to option 1, which is this:
Main:
1  
2  
badGuy1 = new BadGuy();
badGuy2 = new BadGuy();



I was thinking about this initially because my game has about a million "brickwalls" that are just named brickwall1, brickwall2, etc, instantiated in my main game file, and I wanted to see how other people instantiate their objects in their games.

Sounds like you should just use an ArrayList or some other data structure?
23  Game Development / Newbie & Debugging Questions / Re: Should the same objects be made in the same class? on: 2016-09-29 13:27:11
Create 1 bad guy object in my main game file and have that object create the 5 bad guys with an array or something.

Can you be more specific about exactly what you mean by this? Can you put together a small but runnable example that tries this approach out?

This is as much for you as it is for us. Questions like this are best answered by simply trying both approaches out and seeing which one you like the best.

But it sounds like the first approach is "better" since I'm not even sure what the second approach really means.
24  Game Development / Newbie & Debugging Questions / Re: Point changing for some reason on: 2016-09-28 15:20:20
The thing that finally made it click for me was this article on variables: http://www.javaranch.com/campfire/StoryCups.jsp

And its follow-up on passing by value: http://www.javaranch.com/campfire/StoryPassBy.jsp

I highly recommend reading these (in order) for anybody who is still confused about passing by value.
25  Game Development / Newbie & Debugging Questions / Re: Point changing for some reason on: 2016-09-27 12:33:59
Heh, no problem. I like a simpler example anyway:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
public class ReferenceTest{
   public static void main(String... args){
      Integer i = 1;
      change(i);
      System.out.println(i);
   }

   public static void change(Integer i){
      i = 2;
   }
}
26  Game Development / Newbie & Debugging Questions / Re: Point changing for some reason on: 2016-09-27 12:07:21
@Phased: You never actually called the test() function. I think you meant something more like this:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
public static void main(String[] args) {
   MyObject ref = new MyObject();
   ref.a = "nope, not pass by reference";
   test(ref);
   System.out.println(ref.a); //if pass by reference, this should print out "yep, pass by reference"
}

public static void test(MyObject ref) {
   ref = new MyObject();
   ref.a = "yep, pass by reference";
}


Note that the test() function also has to be made static to be called from the main() method.
27  Game Development / Newbie & Debugging Questions / Re: Advice request - Player Movement on: 2016-09-26 14:42:06
Are you using a framework like libGDX? Have you considered using a physics engine?
28  Game Development / Game Play & Game Design / Re: Need more challenges on: 2016-09-26 12:43:46
You haven't really told us about the games you're already doing, so it's a bit hard to tell you what the next step should be.

More generally, it's a little hard to tell you what to do at all: it's a little bit like an artist telling us that they're bored of painting and asking what they should do next. Or a chef asking what they should make for dinner. We can tell you what we would do, but chances are that's not really going to help you. Then again, I know that part of the fun of this forum is just chatting about programming, so I digress.

I'll say this: think outside games. Instead of focusing on games, maybe spruce up the website your games are on (you have one of those, right?). Or look into data visualization, or something more artistic like creative coding. Or make an application, or a video or photo editor, or... the possibilities are endless.

You might also think about trying out different frameworks. If you're an expert in Java2D, try libGDX. Or Processing. Or something else entirely.
29  Game Development / Newbie & Debugging Questions / Re: Object Oriented Game Programming on: 2016-09-23 14:13:29
So, I guess my question is, how exactly do I make 'proper' games,

Practice. Keep programming. The only way to learn how to code is by coding. Start small, and give yourself goals to work towards more complicated topics.

Instead of working on entire games, work on smaller "proof of concept" games (which might not even feel like games). For example, if you want to learn about artificial intelligence, start with something very small: The Game of Nim and Mastermind are good examples of where to start. Then work your way up to Tic-Tac-Toe, then Battleship, then checkers, etc. Start smaller than you think is interesting, and take small steps. This process is going to take a long time (think months or years, not days or weeks), so enjoy the process of learning without worrying too much about making it big or being like Notch (he programmed a ton of small games for years before releasing Minecraft).

what are the mandatory rules and restrictions for programming,

There aren't any mandatory rules, other than what the compiler complains at you about. The most important thing you can do right now is get something working. Then get something else working. Repeat that process over and over again. Anything you write now will look like garbage to you in six months, and that's completely normal. It means you're improving. But it also means that you shouldn't waste too much time worrying about getting everything right. Just get it working, then move on to the next step.

and what is the theory behind it all? By this I mean, what is the process of level systems, artificial intelligence, how to implement sfx, proper cut-scenes and animations -

This is a complicated question. There isn't one theory behind everything. In fact, one of the things that makes programming so fun (and frustrating) is that there are usually a million ways to do any single thing. What's right for one programmer probably won't be right for you. You have to try stuff out and see what fits into your brain the best, then go with that. You're going to end up writing about a million Hello World applications to test out different languages, frameworks, algorithms, approaches, etc. Get comfortable with that. The answer to "which way is better, X or Y" is to try both X and Y and see which you like best.

all the things that one would be expected to know before diving right in and making games?

You don't have to know anything, as long as you start small. Think Pong instead of Mario. This might seem smaller than you think is interesting, but you aren't going to get anywhere if you try to dive in and be at Notch's level right away (again, this process will take months or years, not days or weeks). You learn most of this stuff by experience, and the only way to get that experience is by working on smaller projects until you're more comfortable with larger ones.

We're all on this exact same journey. Good luck.
30  Java Game APIs & Engines / Engines, Libraries and Tools / Re: Starting game development, need guidance? on: 2016-09-15 13:44:43
The only way to find out which library you should use is to try out a few different libraries and see what you like best.

LibGDX is great, but you have to be pretty comfortable with programming, OOP, IDE setup, and looking up documentation and tutorials.

I also really like Processing, especially if you're just starting out.

Just try a few things out and see what you like. Put together a little Hello World application, and feel free to ask specific questions if you get stuck. Good luck.
Pages: [1] 2 3 ... 37
 
ral0r2 (218 views)
2016-11-23 16:08:26

ClaasJG (359 views)
2016-11-10 17:36:32

CoffeeChemist (451 views)
2016-11-05 00:46:53

jay4842 (504 views)
2016-11-01 19:04:52

theagentd (513 views)
2016-10-24 17:51:53

theagentd (504 views)
2016-10-24 17:50:08

theagentd (460 views)
2016-10-24 17:43:15

CommanderKeith (458 views)
2016-10-22 15:22:05

Roquen (431 views)
2016-10-22 01:57:43

Roquen (313 views)
2016-10-17 12:09:13
List of Learning Resources
by elect
2016-09-09 09:47:55

List of Learning Resources
by elect
2016-09-08 09:47:20

List of Learning Resources
by elect
2016-09-08 09:46:51

List of Learning Resources
by elect
2016-09-08 09:46:27

List of Learning Resources
by elect
2016-09-08 09:45:41

List of Learning Resources
by elect
2016-09-08 08:39:20

List of Learning Resources
by elect
2016-09-08 08:38:19

Rendering resources
by Roquen
2016-08-08 05:55:21
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!