Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (516)
Games in Android Showcase (122)
games submitted by our members
Games in WIP (577)
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 ... 51
1  Game Development / Newbie & Debugging Questions / Re: Image Effects on: 2014-10-31 03:57:35
So actual shaders (which is what this sounds like, you said it yourself, but effect also works) are outside the scope or over-complicated, but JS scripting isn't?
2  Game Development / Newbie & Debugging Questions / Re: Image Effects on: 2014-10-31 00:50:57
Yeah P.J is currently a midst a big refactoring, although it doesn't use any OGL, so I'm confused by your recommendation...
3  Discussions / Chitchat Monster / Re: Programmer jokes on: 2014-10-30 21:55:44
Ah, sorry.
4  Discussions / Chitchat Monster / Re: Programmer jokes on: 2014-10-30 21:49:12
Yep.
5  Discussions / Chitchat Monster / Re: Programmer jokes on: 2014-10-30 21:22:03
I like good puns.


No joke, radio!
6  Game Development / Game Mechanics / Re: How to simulate Electricity in Tile-based game on: 2014-10-29 21:06:01
Having nodes and wires as separate things also enables easy "wireless" game mechanics, i.e. a node over here can send power/etc to a node across the room. In game this may be a "wireless network," a "force field," or simply programming convenience, as the "wire" can simply be part of the background/tile image.
7  Game Development / Game Mechanics / Re: How to simulate Electricity in Tile-based game on: 2014-10-29 20:59:37
It sounds like you want each tile to be/have a node, and have wires connecting adjacent tiles.
8  Game Development / Game Mechanics / Re: [SOLVED] Smoothly interpolate between two points? on: 2014-10-29 16:12:26
http://easings.net/

Just for some examples of more elaborate ones.
9  Game Development / Shared Code / Re: Clippy: clipboard history tool on: 2014-10-29 15:01:11
Would I open-source it? Nevah! No time to give support to mere mortals! Emo

Sounds like you need the DAMAIL: https://github.com/nslater/DAMAIL
10  Game Development / Newbie & Debugging Questions / Re: Think im rendering wrong womehow (isometric) on: 2014-10-29 05:39:14
I don't have time atm to read through much, but take a scroll through this thread: http://www.java-gaming.org/topics/isometric-game-design/33434/view.html
11  Discussions / Chitchat Monster / Re: Programmer jokes on: 2014-10-29 02:18:05
And next time you don't know a BBcode feature, quote someone's post that uses it, and you'll see how it was done.
12  Discussions / Miscellaneous Topics / Re: What I did today on: 2014-10-29 01:28:36
It is quite neat. Gamedev specific, have you seen this? https://nightmod.net/
13  Discussions / Miscellaneous Topics / Re: What I did today on: 2014-10-29 00:56:19
Added the beginnings of a half-decent readme for my ghost lang project: https://github.com/BurntPizza/ghost
Don't laugh!
14  Game Development / Newbie & Debugging Questions / Re: All about arrays! on: 2014-10-28 20:12:39
Indeed, the main reason one would abandon many usual "best practices" or comforts is usually performance.

That is (at least partly) why optimization is the root of all evil.
15  Game Development / Newbie & Debugging Questions / Re: Random undirected graph generation on: 2014-10-28 17:30:43
Don't constrain the problem to a specific rendering platform.
It's a graph, all there is are node and edges. They can be rendered however you please, generating the graph has nothing to do with it.

Maybe something like:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
int numNodes = (int) (Math.random() * MAX_NODES);
int numEdges = (int) (/* suitable expression*/);

List<Point> nodes = new ArrayList<>(numNodes);
List<Line> edges = new ArrayList<>(numEdges);

for (int i = 0; i < numNodes; i++)
    nodes.add(new Point((int) (Math.random() * MAX_X), (int) (Math.random() * MAX_Y)));

// this gets more complicated if you want the graphs
// to be simple, or have other specific properties.
for (int i = 0; i < numEdges; i++) {
    Point p1 = nodes.get((int) (Math.random() * numNodes));
    Point p2 = nodes.get((int) (Math.random() * numNodes));
    edges.add(new Line(p1, p2));
}


Then you can render it just by iterating over edges and nodes and rendering lines and circles.
Note that loops must either be eliminated (while p1 == p2, try again, etc.) or handled as a special case in rendering, as currently they will not be visible using just a drawLine() like primitive.
16  Game Development / Newbie & Debugging Questions / Re: All about arrays! on: 2014-10-28 01:29:00
Well, if you have the luxury of knowing how much memory you need ahead of time, then you could use an array.

Or initialize an ArrayList with the proper initial capacity.  Pointing
17  Game Development / Newbie & Debugging Questions / Re: All about arrays! on: 2014-10-28 01:21:47
At least a few of those points are debatable.

A List is a Java-specific (if we're talking about Java Lists) concept.
They are abstractions around various ways of implementing a dynamic array, using various data structures, as opposed to a static ("normal") array.

Not sure what you mean about "been around a lot longer," if you mean arrays have been in since 1.0, and List not until 1.2, then that's not a huge difference, esp. since both concepts have existed long before Java. You don't think the JVM guys would leave core stuff like the collections library not "highly optimized?"

Method calls, especially simple ones like get(), etc. are aggressively inlined, and any differences in performance are often negligible.
EDIT: obviously this depends on the implementation, ArrayList vs array will not have a noticeable difference in most use cases, LinkedList etc. is something entirely different.

Lists, being dynamic, generic, etc., are simply almost always easier to use. That should almost always be the deciding factor.
18  Game Development / Newbie & Debugging Questions / Re: All about arrays! on: 2014-10-28 01:03:15
There are no rules. You use them where/how you deem appropriate.
Unsatisfactory answer? It's the kind of knowledge you gain with experience.

The simplest and most obvious use is indexing: out of this list of things, I want to be able to access any nth one

19  Game Development / Newbie & Debugging Questions / Re: All about arrays! on: 2014-10-28 00:55:20
Take a look at my edit, under "multidimensional arrays."
20  Game Development / Newbie & Debugging Questions / Re: All about arrays! on: 2014-10-28 00:51:14
What do you mean "properly use?"

An array is an array. You use it where ever you would use an array.

Although Lists are usually more suitable.

EDIT: if you don't understand what an array is, well: http://en.wikipedia.org/wiki/Array_data_structure
21  Game Development / Newbie & Debugging Questions / Re: Packing multiple PNG files into one file on: 2014-10-27 02:34:06
Just make a spritesheet out of them? (maybe "Texture Atlas/Map" is more applicable, but you get the idea)

As for readable text format, that is entirely subjective. Preference of it's use is also entirely subjective. For instance, I would consider PNGs in their natural state as images, viewable in any editor far more readable than any text format. They are images after all. Unless of course you're just using PNGs as a convenient medium for the information, but then why bother if you're going to convert them anyway? But as you are making BufferedImages in the end, I suspect that they are in fact images.
22  Game Development / Game Mechanics / Re: JavaScript and Java communication on: 2014-10-25 03:57:31
Nashorn?
23  Java Game APIs & Engines / Java 2D / Re: Fast 2D hardware scaling of images (without GL?) on: 2014-10-24 21:03:42
Yeah, try that, I get another 100 FPS on the blank screen test, and bicubic is just as fast as the others, as opposed to toaster speed.
24  Java Game APIs & Engines / Java 2D / Re: Fast 2D hardware scaling of images (without GL?) on: 2014-10-24 17:31:08
Goes back up to 250 though in a "simulated fullscreen:"

1  
2  
3  
      frame.setUndecorated(true);
-      GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().setFullScreenWindow(frame);
+      frame.setExtendedState(JFrame.MAXIMIZED_BOTH);
25  Java Game APIs & Engines / Java 2D / Re: Fast 2D hardware scaling of images (without GL?) on: 2014-10-24 17:28:35
Oddly enough it goes down to 30 fps in fullscreen mode, scaling or not.
The display mode has a 60 hz refresh rate even.

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  
import java.awt.*;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.awt.image.BufferedImage;

import javax.swing.JFrame;
import javax.swing.JPanel;

@SuppressWarnings("serial")
public class Scaling extends JPanel {
   
   private BufferedImage buffer = new BufferedImage(1280, 720, BufferedImage.TYPE_INT_RGB);
   
   private long lastSec = System.nanoTime();
   private int fps = 0;
   private int fpsDisplay = 0;
   
   public static void main(String[] a) {
      JFrame frame = new JFrame();
      frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      frame.add(new Scaling());
      frame.setUndecorated(true);
      GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().setFullScreenWindow(frame);
      frame.setVisible(true);
     
      frame.addKeyListener(new KeyAdapter() {
         @Override
         public void keyPressed(KeyEvent e) {
            if (e.getKeyCode() == KeyEvent.VK_ESCAPE)
               System.exit(0);
         }
      });
     
      System.out.println(GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDisplayMode().getRefreshRate());
     
      while (true) {
         frame.repaint();
      }
   }
   
   @Override
   public void paint(Graphics g) {
      Graphics2D g2d = (Graphics2D) g;
      g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR);
      g2d.drawImage(buffer, 0, 0, 1920, 1200, null);
      g2d.setColor(Color.white);
      g2d.drawString("FPS: " + fpsDisplay, 50, 50);
     
      if (System.nanoTime() - lastSec > 1000000000) {
         lastSec = System.nanoTime();
         fpsDisplay = fps;
         fps = 0;
      }
      fps++;
   }
}
26  Game Development / Newbie & Debugging Questions / Re: How can I optimize my code: multiple boolean checks on: 2014-10-24 15:20:25
That would work. I wondered if levels could be played non-sequentially.
27  Game Development / Newbie & Debugging Questions / Re: How can I optimize my code: multiple boolean checks on: 2014-10-24 15:04:52
1  
levelsFinished = 0;


Tip: If you ever have lots of bits of code that do more or less the same thing, that's not good.
28  Game Development / Newbie & Debugging Questions / Re: How can I optimize my code: multiple boolean checks on: 2014-10-24 14:58:54
Keep a counter?

1  
2  
3  
if (levelsFinished == 7) {
    reset();
}
29  Discussions / Business and Project Management Discussions / Re: [Help] Looking for: Project Management Software (web) on: 2014-10-24 03:38:12
Trello is good.

I've heard Slack is amazing.

It's not self-hosted stuff, and you might have already seen it, but I figured I'd post it in case you haven't.
30  Discussions / General Discussions / Re: How to make an experience, not a game. on: 2014-10-24 02:22:45
The Extra Creditz episode about Missile Command also demonstrates that. Another important facet.
Pages: [1] 2 3 ... 51
 

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

The first screenshot will be displayed as a thumbnail.

TehJavaDev (32 views)
2014-10-27 03:28:38

TehJavaDev (26 views)
2014-10-27 03:27:51

DarkCart (41 views)
2014-10-26 19:37:11

Luminem (22 views)
2014-10-26 10:17:50

Luminem (27 views)
2014-10-26 10:14:04

theagentd (33 views)
2014-10-25 15:46:29

Longarmx (61 views)
2014-10-17 03:59:02

Norakomi (58 views)
2014-10-16 15:22:06

Norakomi (47 views)
2014-10-16 15:20:20

lcass (43 views)
2014-10-15 16:18:58
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
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!