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   
Pages: 1 ... 6 7 [8] 9 10
 71 
 on: 2016-11-29 21:42:47 
Started by BurntPizza - Last post by SkyAphid
-snip-
Looking forward to play the final game! The alpha was already cool even though I didn't have that much time to try it out unfortunately
Thanks!! We enjoyed having you, and you really helped us pinpoint a lot of critical bugs (or bugs that'd lead to critical bugs lol).

 72 
 on: 2016-11-29 21:29:10 
Started by VoidBuffer - Last post by VoidBuffer
I agree with you. After reading into the MVC pattern for games and how little people use it, I'm leaning towards what you mentioned except with a slight twist. Instead of using:

world.update();
world.render();

I would prefer to put world.render() logic into another class, however make objects in world publicly accessible so that render can use the same objects that are in world. There is no benefit to this besides keeping the code separated and 'cleaner' in my opinion. My project is several thousands of lines and it's getting to the point where I really appreciate Model being separated from View. As I add more and more logic to my game it just makes things easier to find. It would look something like this:

1  
2  
3  
4  
5  
6  
7  
Game {

    public void update() {
        world.update();        // All entities are created and stored in public arrays
        render.render();       // Accesses public arrays in world class to render them
   }
}


Let me know if you see any flaws in that design.

Also to aid my original question, when I get home I'll try applying this implementation with additional salt to fix my particle issue. I wanted to assign a boolean to my entity classes that is switched to true when I want a certain particle effects applied to that entity. For example:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
class Enemy {

    boolean showExplosion;
    boolean showDeathAnimation;

    public Enemy() {
        ...
    }

    ...
}


Since I'll have all my entities stored publicly in my World class, I can iterate all those entities in my Render class to check these boolean flags. If the flags are true I will fire off the effect in the location of that entity. As long as my particle effects "attached" attribute is true, the animation will follow the entity. Which should solve my original issue.

 73 
 on: 2016-11-29 20:59:20 
Started by Spasi - Last post by pateman
This is pure awesomeness. Keep up the great work, guys! Smiley

 74 
 on: 2016-11-29 20:55:15 
Started by philfrei - Last post by J0
By purple bar I meant this here

I now see it could very well be a separator... I've never used JavaFX honestly, so idk. On my computer the rightmost, say 4-5 pixels in width, move in a strange manner. Nevermind, my pc's haunted.

If my current project gets anywhere near something that might see the light of day sometime, I'll get back to you then Cheesy

 75 
 on: 2016-11-29 19:57:05 
Started by TomCoenen - Last post by gouessej
Hi

Why does Economy2.png contain a large empty space under Oil Resource?

I'll put JNDT XML script into a JAR and improve the documentation for Gradle users as soon as possible. I advise you to test your game with OpenJDK as it's what most GNU Linux users use but nowadays there isn't a big difference with Oracle Java.

 76 
 on: 2016-11-29 19:14:47 
Started by philfrei - Last post by philfrei
You should bundle every one of your effects into one big jar Smiley
One question: what does the purple bar represent? I saw it moving but couldn't understand it...
Oh, also: do you think we might be able to use your ambiance library/libraries in our games? I'd love to be able to implement that kind of sound effects in my next project!

Thanks!

I'm curious what the purple bar is that you are seeing. The code only should have a simple JavaFX GUI with buttons and sliders. Are you referring to the 3D-Sound program where I was trying out a time-delay based algorithm for implementing 3D audio? In that, the purple cylinders that rise and sink in place, corresponding to audio source locations. They are loudest when tallest, and quiet when they sink into the "chessboard" floor.

I'm quite perplexed in terms of figuring out what to make freely available or not. I don't want to commit too much of the code yet, as part of my way of development includes rewriting fundamental parts of it as I learn more, and I don't want to be encumbered by obligations for backwards compatibility. (Ran into this with SiVi a couple years ago.)

Yes, it is possible to combine the various into a single library jar.

J0, when you are ready to seriously consider going forward, maybe you can message me and check in on the status of things. (Same to anyone else.) I'd like to be part of a team, and the audio expertise is one of the main things I can bring. I'm also looking for situations to implement "real-world" examples of the library being used.

 77 
 on: 2016-11-29 19:05:58 
Started by bornander - Last post by bornander
A note on tracking progression;

The game is aimed at young kids and because of that I don't want any online aspects, including Google leaderboards or achievements.

The way I let players track their progress is by having a home-world screen where the aliens that have successfully made their way to their space ship can be seen landing.

Click to Play


So as someone completes more and more level, that screen will fill up with colorful, dancing aliens. I am hoping kids will find that amusing.

I think I need to do something about the background though, the gradient currently in use is a bit drab and boring.

 78 
 on: 2016-11-29 19:02:11 
Started by daemor - Last post by FabulousFellini
Ok, nevermind, turns out I had it at work after all.  Here it is (some of the formatting is messed up so let me know if you have questions:

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  
public class ControllerPad {
   
    public JInputJoystick joystick    = new JInputJoystick(Controller.Type.STICK, Controller.Type.GAMEPAD);
   
    public static boolean joystickButton_0;      // X BUTTON
    public static boolean joystickButton_1;      // A BUTTON  
    public static boolean joystickButton_2;      // B BUTTON
    public static boolean joystickButton_3;      // Y BUTTON
    public static boolean joystickButton_6;           // X BOX BUTTON (left trigger?)
    public static boolean joystickButton_7;      // RIGHT TRIGGER
    public static boolean joystickButton_8;      // SELECT BUTTON
    public static boolean joystickButton_9;      // START BUTTON
   
    public ControllerPad(){}
   
     /**
     * getControls() gets called every tick in the game loop
     */

    public void getControls() {
 
    /**
    * Only checks for Type GAMEPAD
    */

    if(joystick.getControllerType().equals(Controller.Type.GAMEPAD)){
        joystickButton_0       = joystick.getButtonValue(0);
        joystickButton_1       = joystick.getButtonValue(1);
        joystickButton_2       = joystick.getButtonValue(2);
        joystickButton_3       = joystick.getButtonValue(3);
        joystickButton_6       = joystick.getButtonValue(6);
        joystickButton_7       = joystick.getButtonValue(7);
         
        float hatSwitchPosition = joystick.getHatSwitchPosition();
    }
   
      if (Float.compare(hatSwitchPosition, Component.POV.UP) == 0 || joystick.getY_LeftJoystick_Percentage() < 30) { }
   
      if (Float.compare(hatSwitchPosition, Component.POV.DOWN) == 0 || joystick.getY_LeftJoystick_Percentage() > 70) { }
   
           if (Float.compare(hatSwitchPosition, Component.POV.LEFT) == 0 || (joystick.getX_LeftJoystick_Percentage() < 35)) { }
   
      if (Float.compare(hatSwitchPosition, Component.POV.RIGHT) == 0 || (joystick.getX_LeftJoystick_Percentage() > 65)) { }
   
      if (joystickButton_0) { }
     
                 else if (joystickButton_1) { }
           
      else if (joystickButton_2) { }
   
      else if (joystickButton_3) { }
   
      if (joystick.getZAxisPercentage() == 0) { }
   
      if (joystickButton_7) { }

      joystick.pollController();

   }

}

 79 
 on: 2016-11-29 18:51:54 
Started by VoidBuffer - Last post by bmanmcfly
Again, keeping in mind my being a noob...

To me, it seems that by having the world class responsible for updating and drawing all game entities, it seems that it overall keeps things simpler than having a world for updating objects and a renderer for putting objects to the screen...

Seems to me its easier if you just go :
world.update();
world.render();

where update is:
- for (object o: objects){
    switch (o.entityIs){
        case (OBJECT TYPE):
             o.update();
             break;
}

So, if your objects create their own effects, then the effects will be updated along with the entity that created them, seems to me, this would make it so that you're not having to do extra tracking of all the effects and locations...

That's still a few milestones ahead of where I'm at though, and haven't done that specifically yet...

 80 
 on: 2016-11-29 18:25:46 
Started by VoidBuffer - Last post by VoidBuffer
@bmanmcfly, that makes sense and seems to be the popular approach to making games. My current setup is that I have arrays of objects in my world class, and I copy those arrays into my render class, which polls for object updates while rendering graphics. This seems to be an inferior setup, because I can benefit more from making my world arrays public, and directly accessing those arrays from my render class instead. Doing this would eliminate the 'duplicating objects' part that I was referring too. Also this would retain a MVC look, instead of putting entity + rendering into one giant class. I guess my goal here is to retain code cleanliness, but this could also help me by allowing me to get direct access to the object for my original particle problem.

@FabulousFellini, that's another possible solution, thanks Smiley It might get a little hairy with variable velocity and rotation, but it's a possibility.

Pages: 1 ... 6 7 [8] 9 10
 
ral0r2 (191 views)
2016-11-23 16:08:26

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

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

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

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

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

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

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

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

Roquen (302 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!