Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (498)
Games in Android Showcase (116)
games submitted by our members
Games in WIP (563)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: 1 ... 8 9 [10]
 91 
 on: 2014-09-22 01:34:36 
Started by shadowstryker - Last post by shadowstryker
Hey everyone, thanks for all the help. In the end I decided to just iterate through every objects in the game, for every object in the game, so that the gravitational pulls are accurate. It will be slow when I increase the amount of objects, but accuracy comes at a price. I'm sure I'll optimize later anyway. Currently making pretty good progress, and I'm working on the gravity itself right now. (Lots of trigonometry, fun!). I'll eventually have a screen-cap for everyone to preview. Soon. Smiley

 92 
 on: 2014-09-22 01:33:33 
Started by Rayvolution - Last post by Rayvolution
The Kickstarter and Greenlight Campaign STARTS TOMORROW!! Woohoo!!! Cheesy

Here's the new tech demo video that will be featured with it. Smiley

5-Month Mark Technical Demo!
<a href="http://www.youtube.com/v/qSqqgIbaTXk?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/qSqqgIbaTXk?version=3&amp;hl=en_US&amp;start=</a>

 93 
 on: 2014-09-22 01:27:22 
Started by tinfoilboy - Last post by BurntPizza
https://www.google.com/#q=why+are+applets+dead

 94 
 on: 2014-09-22 01:25:35 
Started by tinfoilboy - Last post by tinfoilboy
Not for that reason so much I think, but yes. They are well and truly dead. Don't bother.

What would you say the reason for their demise is? Just kind of wondering.

 95 
 on: 2014-09-22 01:24:23 
Started by tinfoilboy - Last post by BurntPizza
Not for that reason so much I think, but yes. They are well and truly dead. Don't bother.

 96 
 on: 2014-09-22 01:23:21 
Started by tinfoilboy - Last post by tinfoilboy
I think I've heard from some topics around here that Java applets are "dead", because you have to pay for a cert or something. Is that true, or did I mishear something?

 97 
 on: 2014-09-22 01:06:08 
Started by JayManHall - Last post by Andre Lopes
Mine goes without saying.

 98 
 on: 2014-09-22 00:57:14 
Started by Andre Lopes - Last post by Andre Lopes
Well im still looking for an API, nothing decided yet.
Aparapi might also be in the scope.

 99 
 on: 2014-09-21 23:40:28 
Started by tinfoilboy - Last post by BurntPizza
That's literally just a (messily done) deep copy.
It's still not thread safe at all.

 100 
 on: 2014-09-21 23:35:14 
Started by tinfoilboy - Last post by radar3301
So the update thread waits for the rendering thread and the rendering thread waits for the update thread. Which turns this into an extremely complicated way to do exactly the same thing as just a single thread performing update and render, or am I missing something here?
Well, I was thinking something more along the lines of
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
class Entity {
    float x, y;
    float lockedX, lockedY;
    void lock() {
        lockedX = x; lockedY = y;
    }

    void render() {
        GraphicsObject.drawWhatever(lockedX, lockedY);
    }
}

class RenderThread {
    void render() {
        for (Entity e : entities)
            e.lock(); // lock the entity
       for (Entity e : entities)
            e.render(); // render the entity
   }
}

I hope that's understandable. Looking at it now, I suppose it's a rather unwieldy with the multiple for loops, but the locking code shouldn't take too long, and while rendering is happening, updates to the entity's position can still occur without glitching the graphics.

Also, neither solution solves the problem posed by the OP: how to make movement independent from framerate.
Another thought I just had...

I was once trying to build a (somewhat accurate) physics simulator for projectiles/particles, but I was getting frustrated since the framerate dropped when I was rendering a lot of them. After thinking about it for a while, I decided upon this solution (forgive me if I didn't fully expand the threads properly, this was just a quick 10 minutes) :
http://pastebin.java-gaming.org/efa701a8c0714

Pages: 1 ... 8 9 [10]
 

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

The first screenshot will be displayed as a thumbnail.

radar3301 (12 views)
2014-09-21 23:33:17

BurntPizza (30 views)
2014-09-21 02:42:18

BurntPizza (22 views)
2014-09-21 01:30:30

moogie (20 views)
2014-09-21 00:26:15

UprightPath (28 views)
2014-09-20 20:14:06

BurntPizza (32 views)
2014-09-19 03:14:18

Dwinin (48 views)
2014-09-12 09:08:26

Norakomi (74 views)
2014-09-10 13:57:51

TehJavaDev (102 views)
2014-09-10 06:39:09

Tekkerue (50 views)
2014-09-09 02:24:56
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

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
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!