Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (711)
Games in Android Showcase (213)
games submitted by our members
Games in WIP (785)
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 ... 49
1  Discussions / Miscellaneous Topics / Re: Programming in schools - opinions? on: 2017-02-23 02:42:36
My brother is a programmer and immigrated to Germany, He had met a German national in SF and married her--they decided to make Germany their home. They decided to not expose their daughter to computers until into her teenage years. Instead she spent her extracurricular time learning things like origami, juggling, playing flute, horse-back riding, gymnastics. This year, though, I received a pretty slick Calendar she made herself, presumably with the assistance of a computer graphics program. AFAIK, waiting until she was into the equivalent of Junior High before getting into computers and the Internet has worked out just fine. I don't know if this is common in Germany or not, to limit exposure to computers until after social and intellectual skills have had a chance to develop.

I wouldn't be so strict about the no-computers rule if I were a parent. (They also severely limited TV time.) But in her case, it certainly seems no harm was done by waiting.

I don't know that trying to teach "logic" at an early age is necessarily going to take. "Logical thinking" may have requirements that don't develop right away, kind of like trying to teach a kid about "object permanence" before they've recognized that Peek-a-Boo is a playable game.

Efforts were made to make Mathematics more about abstract principles and higher thinking ("new Math") and success was definitely mixed at best. Since computers are everywhere, a certain amount of computer literacy and ability makes perfect sense. There's nothing like running experiments, trying different teaching strategies and seeing what actually works, as opposed to getting stuck on an ideal or notion of what is best and pushing that on everyone.
2  Games Center / WIP games, tools & toy projects / Re: Hexara rewrite with Java 8 & JavaFX on: 2017-02-16 00:03:27
Some progress made this week to post. Continuing to work on "presentation layer." Worked on the glyphs or beads or whatever these piece tokens are. Below is a set testing some colors. I won't use all the combos, and might tweak them some more. But am trying not to get too nit-picky, as they are in the ball park.

The glyphs themselves are pngs, where the data in them is being used as a stencil. They were inspired by some religious and mystical symbols as well as scientific symbols and icons. I have this notion that each corresponds to a part of life--and the puzzle is to get all of them to fit together.

The colors and shapes are procedurally made. I took a Photoshop tutorial on how to make "gems" and tried to implement it in Java, putting in things like edge darkening, a top-down whitening (Y-axis), and an "inner glow" (made from an oval-band-gradient tool I made). Was able to come up with some significant improvements on the code I originally wrote. For one thing, I only load the "glyphs" once now instead of every time a new bead is made. For another, making the oval-band and the edge-darkening cutout for the hex, I realized that it was possible to take advantage of horizontal and vertical symmetry, and only calculate 1/4 of the area values.

Also, added to the "Pavilion", including animated incense/smoke pots. Can be seen in the latest in-progress jar on the first post. But here is a graphic.

Was pleased to get what were previously rectangular supporting beams to be round columns. I don't know why that defied me originally. Then again, I've already forgotten how I did it. Would have to read the code to see how the shading and angles of the contact points (roof, floor) were done.
The smoke is a simple particle system. The particles are 40x40, ranging from 1 to 0 over distance = 20. I originally was using a simple linear interpolation, where the value from 1 to 0 was directly proportional to the distance. These values are used as the alpha track on the smoke color that fills the rectangle. But it looks better (I think) when squaring the values. This makes the taper fade better at the transparent end. Again, figured out I could use quadrilateral symmetry and only calculate 1/4th of the rectangle.  Also, the base array (a double[][]) is only made once. The 72 or so (haven't entirely settled on the count yet) progressive images make use of ImageView, and scale the base array, by giving each a gradually diminishing overall alpha and by compressing the early particles on the x-axis and widening them progressively on the X-axis for the later stage particles. The "smoke-genies" have some real time controls for how much they wobble and how high they go. It is possible to introduce a leftward or rightward "wind". I plan to make the smoke pots get more "active" as the user gets closer to solving the puzzle.

A lot of little touches that really have nothing to do with the puzzle mechanic itself, I know. But my idea is that the puzzle-game is as much about the setting, creating an appealing/peaceful/mysterious place that also supports mental concentration.

I have a bit more to do on the presentation basics: the panels and the hex grid. Then move on to working on the "model" layer, and "controller" layer. There remains implementing some glow sequences, as well.
3  Game Development / Newbie & Debugging Questions / Re: External class error on: 2017-02-15 05:37:15
OK, I see the init (line 57). Not clear to me when Slick calls Init (I don't know slick very well, haven't used it in a long time), but it seems to me that the root of your question is elsewhere.

Is there a particular reason you want to create MyClass instead of just having card2 be an Image?

If your goal is to create a "wrapper" class for Image, following are two approaches. The problem I am seeing is that your original MyClass combines the two approaches in a way that isn't working.

1) MyClass 'contains' an Image.

In this case, do not Extend Image. Just hold a copy of the Image and provide a means for populating MyClass with the desired Image (either hardcode in constructor, or pass an argument in the constructor or a set() method) and a draw method that calls the draw method of the image.

For example:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
public class MyClass
{
   Image cardImage;

   public MyClass() throws SlickException
   {  
      cardImage = new Image("img/card.png");
   }

   // alternative constructor for allowing different images to be specified
   public MyClass(String imgAddr) throws SlickException
   {  
      cardImage = new Image(imgAddr);
   }

   public void draw(int x, int y)
   {
      cardImage.draw(x, y);  // I'm guessing this is the Slick syntax for an image draw method.
   }

   // Additional code that provides functionality that is not part of slick.Image

}


2) MyClass extends Image.

In this case, you will want super(cardImage); in the MyClass constructor. As for drawing, if you don't override the draw method of Image, you can call it directly on MyClass.

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
public class MyClass extends Image
{

   public MyClass() throws SlickException
   {
      super("img/card.png");
   }

   // alternate constructor, allowing you to specify different cards
   public MyClass(String imgAddr) throws SlickException
   {
       super(imgAddr);  
   }

   // Additional code that provides functionality that is not part of slick.Image

}



4  Game Development / Newbie & Debugging Questions / Re: External class error on: 2017-02-13 03:13:06
Did you instantiate card2? I don't see this happening.

The error message refers to an NPE on line 47, which is why I am asking about the card2 variable.
5  Discussions / General Discussions / Re: Steam Greenlight to be replaced with Steam Direct on: 2017-02-12 02:02:17
I read and commented on the article on GamaSutra.

Taking the stated goal at face value (to improve quality of submitted games), it seems to me it would be good to get some data on the distribution of how many games sell in a fixed period (say, three or four months--time enough for comments to affect sales) and what the comment rating average is and how it correlates to sales.

IF there is some sort of correlation, poorly rated games selling poorly, then they could make the deposit that corresponds to that magic number of games just beyond where the majority of poorly rated games peter out. Maybe it is 100 units?

Take that 100 and multiply it by the selling price of the game. Then, a $1 game would require a $100 deposit and a $50 game would require a $5000 deposit. These figures just happen to correspond to the range of deposits they are discussing. And I suspect there is a general correlation of game price with the resources of the team making the game and their ability to cover the deposit.

Some games are made with a minimum of creativity or effort, e.g., quick or easy variations on an existing mechanic requiring some surface graphics or programming changes. If there is a risk/reward ratio that can inhibit people that post things with the idea "nothing to lose" then maybe that would help fulfill the goal of reducing the massive number of games being entered.

I am not in a position to advance more than a couple hundred dollars at this point for an entry. I'm thinking about Hexara as being perhaps my first effort going to Steam. It is going to appeal to a subset (puzzle game players) and as I have no previous entries or track record, I don't expect to sell a whole lot of units. Putting up more than a couple hundred dollars would be a considerable strain and risk. I will probably go to other venues rather than try to sell Hexara at Steam.

Anyway, these were my first reactions. I'm not sure if the intended consequences would play out as hoped.
6  Discussions / Miscellaneous Topics / Re: Saving, loading—oh no! Semi-tutorial? on: 2017-02-09 03:02:28
When I think about implementing saving and loading, I am also including things like figuring out how to set and update a default file folder. Is it so obvious how to do this? I would include this aspect in a tutorial. The short answer is that this can be provided via util.Properties, but I probably overthought it and got a little complicated with coding the default to be updated whenever a new file folder is used. Also, tutorial would include how to set up a MenuBar correctly with a save/load and import/export. Making space for a MenuBar on a game screen (if you use one) can be annoying. Also, little things like tracking high scores or other user properties for different users might also require management and all this is separate from storing the state of a game.

As for storing game state, for the simple stuff I am doing, XML is working. I went through a bit of a quandary before deciding what forms to use for incoming and outgoing. I got scared off of using Serialization, in part because of a nightmare story from a friend working on a contract on a Java project with faulty Serialization that was crashing the program, and not wanting to maintain or upgrade "older version" save files. (At least with XML, you can always inspect the contents easily, even if you can't load the files.) But from what princec says, a lot of the fears about Serialization are overstated, and it actually works fine.
7  Discussions / Miscellaneous Topics / Re: What I did today on: 2017-02-09 02:45:50
I finished and submitted a web article. It's about the physics of the oboe, a sort of intro level thing, discussing the basics. If it gets posted, it will be on a site called HyperPhysics. I was invited to submit something when I pointed out a few corrections, a couple months ago, to statements on their oboe page. Couldn't resist the opportunity, but writing sure is difficult! It is especially so when your knowledge is more geared to working with the ideas, not knowing who came up with what and when, and how this theory is different from that, and providing citations for all assertions. I hope it turns out to be interesting and useful to at least a few people, and not just a glorified "book report."

Am going to get back to working on Hexara, now, and hopefully this time won't allow myself to get derailed with any other projects.
8  Discussions / Miscellaneous Topics / Re: What I did today on: 2017-02-03 20:42:52
I was working on saving and loading for my game—it turns out I’m not capable of such a simple thing. Here is absolute proof that years of experience doesn’t help you in your dragon-slayer-kill-them-now-epic-stuff quest to ultimate game development mastery! Pointing

I know what you mean. (I think.) It was a significant chore figuring out how save/load settings for the simple sound apps I've been working on. I'm happy to share what I figured out if you start a new thread on this question.
9  Discussions / Miscellaneous Topics / Re: What I did today on: 2017-02-03 20:38:34
Thanks everyone!  Smiley  Smiley  Smiley
@philfrei great work not dying so far!
Seriously. Knock on wood.
10  Discussions / Miscellaneous Topics / Re: What I did today on: 2017-02-03 07:46:37
Turned 60. Shocked
11  Discussions / Miscellaneous Topics / Re: What I did today on: 2017-02-02 01:17:59

Maybe I should have said "nice song" since that is what you called your new musical piece. I tend to think of songs as having singing. I just meant "by the way" for the btw.
12  Discussions / Miscellaneous Topics / Re: What I did today on: 2017-02-01 23:33:58
..whups..
13  Discussions / Miscellaneous Topics / Re: Retrieve random point inside regions of Perlin noise? on: 2017-02-01 19:11:30
I'm not sure if I understand the scenario.

Perlin returns [-1..1], and you wish for noise values > 0.2 to be of a certain special type.
A variable number of contiguous tiles generated this way, forming blobs or islands.
On each island, there should be one "special" tile, which I will call the X tile.
Given the goal of "infinite world" it would be good to be able to identify the X tile procedure based upon the region itself, rather than maintaining some sort of list.

It occurs to me that some of the islands will be quite large, and some will be as small as a single tile. I'm thinking you will want a minimum number of tiles to be fulfilled before you include the X tile, e.g., there must be at least 10 tiles in the island if there is going to also be an X tile.

One could work with the geometry of the shape itself: using a floodfill algorithm to determine the complete extent of the island when you come across it. Then apply a hash function to the shape.

I like the idea of a hash giving 13 possible outcomes. With 13, one could have a "clock" of 12 regions and a central area. Then, place the X tile in the center of the hash-derived sector. Or, if one wants more variety, give the hash more possibilities, and break the island into corresponding sectors.

What would be a good hash? I don't know. Maybe use the number of tiles in the island, but also add in the number of corners or the side lengths, and then do a mod division? How divide the varied island shapes into sectors? I'd have to think about that, as well. The main requirement is that it is a function of the shape that is found.
14  Discussions / Miscellaneous Topics / Re: What I did today on: 2017-02-01 08:10:56
I’ve been here before. It feels good to recognize almost everybody here with the exception of nobody recognizing me! Appreciation given to anyone who can figure out who I really am. Cool

My guesses are as follows:
97% confidence: Icecore (clues: Swedish connection, lots of emoticons, Icecore has not posted since Nov or so)
2% confidence: Huh
1% confidence: Notch impersonating Icecore.

Quote
Do any of you produce music?
Yes. But lately I've gotten more interested in using Java to generate music.
Nice cue, btw.
15  Games Center / WIP games, tools & toy projects / Re: RainThunder on: 2017-01-31 22:43:13
Quote
Would there be any possibility of you bundling up just the important classes into a jar? I’ll make sure to put you in my game’s credits!

Sure. A mention would be great! We can also go back and let the recordists at FreeSound.org know as well. There is no fee--these are free--but the recordists like to hear when something has been used in an app. I've got links to the original files.

Actually, you can try running the jar as is, if you link it into your project. The main "excess" is the GUI class which is pretty lightweight and can just be ignored, probably.

I was noticing the other night that if I have two or three sound-playing jars open at the same time, this one starts experiencing dropouts. It runs fine, otherwise, and has low cpu usage afaik. But for sure, test it before making it a go for your game. I have been planning to investigate as to what the bottleneck might be but haven't had a chance to follow through, yet. If it is happening in your game, please let me know and maybe we can look into it further.

Also--I can probably hone it down if you want to lose either the wind or rain parts or really do need to get rid of the GUI. The animation timer isn't needed for the thunder, just the wind/rain.

Below is the "SoundHandler.java" class that is used to control the app. Are you able figure out how to use the jar via the public methods here? I apologize for some laziness in the coding that might cause confusion, e.g., should have renamed updateVolume() to updateParameter() since it was expanded to do more than just set volumes.

So, make an instance of SoundHandler, and call soundHandler.start() to get the audio engine rolling. Then use the other start/stops to turn things on/off, and updateVolume, using the enum of parameters, for the aspect you wish to control. The parameters updates are set to respond to normals (0..1) for the ranges.

Be sure and include the stop() method when shutting down, or else the thread pool executor in EventSchedulingThreadPool will keep running.

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  
87  
88  
89  
90  
91  
92  
93  
94  
95  
96  
97  
98  
99  
100  
101  
102  
103  
104  
105  
106  
107  
108  
109  
110  
111  
112  
113  
114  
115  
116  
117  
118  
119  
120  
121  
122  
123  
124  
125  
126  
127  
128  
129  
130  
131  
132  
133  
134  
135  
136  
137  
138  
139  
140  
141  
142  
143  
144  
145  
146  
147  
148  
149  
150  
151  
152  
153  
154  
155  
156  
157  
158  
159  
160  
161  
162  
163  
164  
165  
166  
167  
168  
169  
170  
171  
172  
173  
174  
175  
176  
177  
178  
179  
180  
181  
182  
183  
184  
185  
186  
187  
188  
189  
package com.adonax.weather;

import java.io.IOException;
import java.io.InputStream;

import javax.sound.sampled.UnsupportedAudioFileException;

import com.adonax.pfaudio.cliptools.SuperSlicer;
import com.adonax.pfaudio.core.CoreMixer;
import com.adonax.pfaudio.core.JavaWrapper;
import com.adonax.pfaudio.events.EventSchedulingThreadPool;
import com.adonax.pfaudio.io.PFClipData;

import converter.OggVorbisToPCMFloats;
import javafx.animation.AnimationTimer;

public class SoundHandler {
   private CoreMixer mixer;
   private JavaWrapper jw;
     
   private SuperSlicer windSlicer, rainSlicer;
   private float baseWindVol, baseRainVol;
   private float turbulence;
   
   private ThunderAmbience thunder;
   
   public enum Attribute { WIND_VOLUME, RAIN_VOLUME, TURBULENCE, THUNDER_VOLUME, THUNDER_INTENSITY,
      THUNDER_FIXED_PAUSE, THUNDER_RANDOM_PAUSE};
   
   public SoundHandler() throws UnsupportedAudioFileException, IOException
   {
      mixer = new CoreMixer();
      jw = new JavaWrapper(mixer);  
      new EventSchedulingThreadPool(10);
     
      float[] pcmFloats;
      PFClipData clipData;
      InputStream inputStream = null;

      // * * * * * * * *
      //   Forest Wind in Trees
      // * * * * * * * *
      inputStream = this.getClass().getResourceAsStream(
            "../wind/audio/25945__inchadney__owl__WIND_IN_TREES.ogg");
     
      if (inputStream == null) System.out.println("inputStream not found");
     
     
      pcmFloats = OggVorbisToPCMFloats.makePCMFloats(inputStream, 141_324);
      clipData = new PFClipData("wind in trees ogg", pcmFloats);
      windSlicer = new SuperSlicer(clipData, 44100 / 2, 1024 * 8);
     
      mixer.addTrack(windSlicer);
     
      // rain
      inputStream = this.getClass().getResourceAsStream(
            "../wind/audio/244053__lennyboy__thunder_rainclip.ogg");
     
      if (inputStream == null) System.out.println("inputStream not found");
     
     
      pcmFloats = OggVorbisToPCMFloats.makePCMFloats(inputStream, 93_904);
      clipData = new PFClipData("rain ogg", pcmFloats);
      rainSlicer = new SuperSlicer(clipData, 44100 / 2, 1024 * 4);
     
      mixer.addTrack(rainSlicer);
     
      // thunder
      thunder = new ThunderAmbience();
      mixer.addTrack(thunder);
     
      LFPeriodicNoise wave = new LFPeriodicNoise(30);
     
      AnimationTimer timer = new AnimationTimer()
      {
         final int TUBE_LEN = 24; // 60 = 1 second delay
         float[] delayTube = new float[TUBE_LEN];
         int iWrite, iRead;
         
         void updateDelayTube()
         {
            iWrite++;
            iRead++;
            if (iWrite >= TUBE_LEN) iWrite = 0;
            if (iRead >= TUBE_LEN) iRead = 0;
         }
         
         @Override
         public void handle(long arg0)
         {
            wave.setPeriod((int)((1 - turbulence) * 60) + 30 );
   
            float flt = wave.tick() * (turbulence/3);
            delayTube[iWrite] = flt;
            rainSlicer.setVolume( baseRainVol * (1 + delayTube[iRead]) );
            windSlicer.setVolume( baseWindVol * (1 + flt/2) );
           
            updateDelayTube();
         }

      };
      timer.start();
   }
   
   // *************************
   //    INTERFACE METHODS
   // *************************
   
   public void start()
   {            
      jw.start(null);
   }  
   
   public void stop()
   {
      jw.stop();
      EventSchedulingThreadPool.shutdown();
   }
   
   // Inputs should be normalized [0, 1]
   public void updateVolume(Attribute attribute, float value)
   {
      switch(attribute)
      {
      case WIND_VOLUME:
         baseWindVol = value / 8;
         
         break;

      case RAIN_VOLUME:
         baseRainVol = value / 6;
         
         break;

      case TURBULENCE:
         turbulence = value;
         break;
         
      case THUNDER_INTENSITY:
         thunder.setIntensity(value);
         break;
     
      case THUNDER_VOLUME:
         thunder.setMasterVolume(value);
         break;

      case THUNDER_FIXED_PAUSE:
         thunder.setFixedPausePart(value);
         break;
      case THUNDER_RANDOM_PAUSE:
         thunder.setRandomPausePart(value);
         break;

      default:
         break;
         
      }
   }  
   
   public void startWind()
   {
      windSlicer.play(0, 0);
   }
   
   public void stopWind()
   {
      windSlicer.stop();
   }
   
   public void startRain()
   {
      rainSlicer.play(0, 0);
   }
   
   public void stopRain()
   {
      rainSlicer.stop();
   }
   
   public void startThunder()
   {
      thunder.start();
   }
   
   public void stopThunder()
   {
      thunder.stop();
   }
}
16  Discussions / General Discussions / Re: How do you Guys manage it? on: 2017-01-27 06:27:44
I mostly leverage things like perlin textures, particle generation effects with maybe a little pixel art. Understanding perspective and anti-aliasing can lead to a surprising amount. Also learning a bit about visual composition. There's a fair bit you can do with basic shapes.

Haven't managed to snag a artist as a collaborator yet. Am hoping that finishing Hexara will add to my credibility on that front.
17  Discussions / Miscellaneous Topics / Re: What I did today on: 2017-01-24 19:44:01
Spent some time making a few shaders for my next game:



The blur one is a little cheap so if anyone could point me to helpful resources that would be awesome! Or if you have any other ideas of cool looking effects for a 2D strategy game please share Pointing

Btw the ninja sprites are from gameart2d

J0 Smiley

I'd like to do a "ripple-fade" of some sort. I think there is a JavaFX tool that lets you create a 2D map of translation values, the name is escaping me at the moment. I have yet to investigate how to animate a series of such translation values so that a "rippling" occurs. The fading part is easy, handled via an opacity property. I worry that creating a large array every animation cycle will be too costly--but probably that will be just fine and will be the way to go. Saving a cycle of several dozen might work also. I probably worry too much about using up memory.
18  Discussions / Miscellaneous Topics / Re: What's in your gamedev software rig ? on: 2017-01-24 19:34:45
Most of my dev is on a Dell laptop I bought second-hand, 15 months ago. Runs I3, Windows 10.

Java8 (including JavaFX)
Eclipse Neon

libraries:
my own audio library
gustafson's Perlin Simplex Noise implementation
jcraft's ogg decoder

external tools:
Audacity
microsoft paint on rare occasions when making an icon

For 2D games -- don't need to get too deep into 3D tools.
The little 3D I do is a simple JavaFX, mostly as a testing site for 3D audio experiments.
19  Games Center / Android Showcase / Re: [Free] Entanglement on: 2017-01-22 05:29:40
Looks like a fun challenge! Congratulations!

I just wonder about the title. When I first saw the post (title of post only, before calling it up), I was thinking this was the Gopherwood Studios game of the same name.

Are there ways you get "tangled up" while playing?

I always wonder about that sort of thing, having duplicate names. With so many games being made, it seems kind of inevitable that it will happen.
20  Game Development / Game Mechanics / Re: Where exactly does the input code go? on: 2017-01-20 05:42:01
Hmmm.

Do you have a class "Keyboard" that is implementing KeyListener?

If so, I'd be strongly tempted to make the class variables 'up' and 'down' static. Then you don't have to pass this class to every object that needs to consult keyboard state.

So, in player.update(), yes, reference those variables. As long as you never write to these variables from anywhere except the implementation of KeyPress, KeyRelease, etc., it seems to me they are ok as public variables. Or to be safe, only write a get() and no set() and make the variables private. It might be good to make the variables volatile, but this is where things get a little hazy for me.

This Keyboard class itself wouldn't have to be called by update(). The 'up' and 'down' (and 'left' and 'right' or whatever) variables are updated asynchronously, when the KeyListener implementation methods run (when the keys are pressed).


OK, just thought of an exception. There might be some sort of game state occurrence that triggers where you'd want the keys to do something different. Message that to the Keyboard class via settable variables in the class, and consult them as needed (might be either via a game-loop update cycle or when the KeyPress/Release methods execute).
21  Game Development / Newbie & Debugging Questions / Re: Problems with key event handling on: 2017-01-19 22:01:32
Quote
I'm moving away from polling to interrupting, though, because I eventually want to use it in bigger projects where it needs to be more flexible and be able to handle mechanics like key mapping.

I don't see how key mapping is easier one way or another. It seems to me that separating the key input from the update will probably be more flexible, ultimately. Key input is asynchronous. So it makes sense to keep this in its own thread, and use messaging to the Update thread. This plan makes potential concurrency-related conflicts less likely. I assume the updating goes at a sufficient rate that each loop is "soon enough" for a given key event to be handled.
22  Games Center / WIP games, tools & toy projects / Re: Hexara rewrite with Java 8 & JavaFX on: 2017-01-18 23:00:47
The screen with dunes and stars is background on the main game screen. Foreground is coming.

Project got bumped by work (thank you, Microsoft, for causing needless churn and billable hours with updates that aren't 100% compatible with older versions), two sheet music orders to print (and printer heads that turned out to be cleanable--thought they were destroyed by inexpensive, refilled ink cartridges--almost signed away publishing rights when I thought printer was goner), an article invited to write for the hyperphysics site (almost done), finishing application to tutor on Wyzant. Hopefully I will be back on this by next week at the latest!

Yes, also found the API doc on AnimationTimer being executed on JFX application thread. Thanks again!
23  Game Development / Performance Tuning / Re: Turn-based game - world map performance issue on: 2017-01-17 04:05:44
Definitely need to see what is happening when the lag occurs. I wouldn't assume it is strictly because of the time taking to load everything--it could also be a result of what is done with the images once they are loaded.

One thing in the back of my mind, also, is wondering whether and how images are being used multiple times. It could make a difference if every instance is a Image or WritableImage, or if one is using multiple ImageView's that all tap into the same base image.
24  Game Development / Newbie & Debugging Questions / Re: getting rid of "instanceof" on: 2017-01-16 04:42:11
Quote
Whew! Java sure is verbose. Anyway, I was wondering if anybody had a good explanation of the difference between <? super >and <? extends>. I googled around and found some explanations, but it didn't really sink in for me.

They are kind of like a greater than or less than, but referring to the extends chain. One gets the class and all super classes, the other gets the class and all sub classes.
25  Game Development / Newbie & Debugging Questions / Re: getting rid of "instanceof" on: 2017-01-12 20:27:29
Thanks to folks to contributing to this discussion. I am very much looking forward to examining the discussion points in detail.

It seems to me, on general principles, if a subclass doesn't allow you to use the same methods of the parent class, differences being accounted for via Override, then something is fishy about the decision to subclass in that instance.

I will have to dive into the details to figure out why collision-testing is not something where one can simply make an Interface, e.g., Collidable or OccupiesSpace, and cover the needed object requirements in the various implementations of the method, so that the same method call can suffice. Seems to me like it should be possible. But, I haven't had to do collision testing in my game or audio programs, and the alternative algorithm that I tested (mapping the object to a grid similar in size to the actual screen, and testing the points you traverse or move to for occupants before occupying them), worked pretty well.
26  Game Development / Newbie & Debugging Questions / Re: getting rid of "instanceof" on: 2017-01-10 21:37:08
My current notion for handling "states" is to make use of enums.

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  
    class Ball 
    {
        enum State {NORMAL, SOME_OTHER_STATE};
        State state;

        public Ball()
        {
            /*
             *  Code that initializes the state variable in the constructor, probably.
             */

        }

        @Override // for an Interface such as one for animatable objects.
        public void update()
        {
            switch (state)
            {
                case NORMAL:
                    doSomething();
                    break;
                case SOME_OTHER_STATE:
                    doSomethingElse();
            }
        }
    }


In other words, I tend to hold variations in state as properties, not as separate subclasses.

If you are going to use subclasses, that seems to me to imply also making collections that are specific to the subclass (e.g., ArrayList<NormalBall>) and coding routines specifically for iterations through those collections, rather than testing every Object with instanceof. But if taking a route such as this, I think using Interfaces makes more sense than subclassing.
27  Games Center / Showcase / Re: Equal on: 2017-01-09 08:51:09
I like that the timer now shows in the two choices. Good idea!

Using the PC version, as far as I could tell, the two games (Challenge and Time Attack) were identical. On Time Attack I didn't see where I was accumulating any time, and a single mistake ended the game.

Also, it would have been nice to first play one then another without having to exit the program and reload it. Is there a way to navigate from one to the other without reloading?
28  Games Center / Showcase / Re: Equal on: 2017-01-06 18:53:24
I like the idea of earning time -- perhaps it can be related to how quickly the person answers? If faster answers are profitable, this motivates players to find quicker ways to disprove or prove the propositions, rather than use the entire segment to ensure correctness of an answer.

But it is probably good to resist adding complexity (or making it optional), as there is value in clarity.

The shape/mode of the timer might require tinkering to fit in between the buttons.
29  Games Center / Showcase / Re: Equal on: 2017-01-06 08:32:59
Fun!

I'm wondering if it is possible to allow key strokes, (A and F?) for the = and <>. I can press a button quickly, but my mousing is quite a bottleneck in terms of reflexes and speed. Moving the mouse seems to me an unwelcome distraction from evaluating the equations.

I'm wishing the timer were in between the two equations, or somewhere closer. My peripheral vision is not so good.

At first I was bugged that the rounds were of different lengths, especially when they got longer. It took me a while to realize that the point is to see how many you can get correct in a row!

I am playing a desktop version on Windows 10.

Thanks for that. Good work!
30  Java Game APIs & Engines / Engines, Libraries and Tools / Re: {LibGDX} How do you make your UIs? on: 2017-01-05 20:08:36
I see it even upsets the forum's code tag syntax highlighter Smiley

Cas Smiley

Made me laugh.

I also appreciate the JavaFX suggestion.

I think the "if" clause ("if UI-heavy") is worth highlighting. UI components and Canvas and Image (WritableImage ~= BufferedImage, and ImageView allows easy transformations) -- they are all Nodes. This equivalence of status is very helpful for coding a UI-heavy game.

But of course, that doesn't help if you're already committed to libgdx.
Pages: [1] 2 3 ... 49
 
numerical (205 views)
2017-02-21 07:32:16

numerical (205 views)
2017-02-21 07:31:46

theagentd (315 views)
2017-02-18 13:42:33

theagentd (315 views)
2017-02-18 13:35:16

h.pernpeintner (1480 views)
2017-01-24 22:39:11

h.pernpeintner (1467 views)
2017-01-24 22:38:32

Galdo (2032 views)
2017-01-12 13:44:09

Archive (2062 views)
2017-01-02 05:31:41

0AndrewShepherd0 (2599 views)
2016-12-16 03:58:39

0AndrewShepherd0 (2336 views)
2016-12-15 21:50:57
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!