Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (732)
Games in Android Showcase (221)
games submitted by our members
Games in WIP (806)
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: 2017-07-20 01:51:02 
Started by tariqbroadnax - Last post by KevinWorkman
How exactly is
1  
rigidBody.getCollisions()
calculated? What exactly does it contain?

If you need to know which characters are colliding with
1  
rigidBody
, why don't you have something like this:

1  
2  
3  
4  
for(CharacterCollision collision : rigidBody.getCharacterCollisions())
{
  collision.getCharacter().getEffects().applyAll(effects);
}


I'm also a little suspicious of why you need to keep around a collection of what's colliding instead of doing applying the effects whenever you detect the collision, but in any case I think you should just go with whatever makes the most sense to you.

 72 
 on: 2017-07-19 23:32:00 
Started by tariqbroadnax - Last post by tariqbroadnax
The following describes something that happens in my game:

Projectiles should apply effects to whatever character collides with them.

Here the code I have:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
for(Collision collision : rigidBody.getCollisions())
{
 if(collision.collider instanceof Character)
 {
  Character character = (Character) collision.collider;

  character.getEffects()
               .applyAll(effects);
 }
}


I am not too fond of instanceof. However, I cannot think of any satisfying way of doing this. I even googled how to replace instanceof but all the examples were rudimentary and did not apply to this situation.

Here of some other ways I thought of doing it and why I dislike them:

1. Entity type enum ---
Just a poor man's version of instanceof.

1  
2  
3  
4  
5  
6  
7  
8  
9  
for(Collision collision : rigidBody.getCollisions())
{
 if(collision.collider.getEntityType() == EntityType.CHARACTER)
 {
  Character character = (Character) collision.collider;

  character.getEffects().applyAll(effects);
 }
}


2. Keep a list of all characters ---
This also does not scale well because I could keep doing this and have 10-20 (maybe exaggerated) lists for each subclass. Also, my scene, which would store these list, does not care what the subclass is. However, the fields of my scene do need to know, making this complicated.

1  
2  
3  
4  
5  
6  
7  
8  
9  
for(Collision collision : rigidBody.getCollisions())
{
 if(scene.getCharacters().contains(collision.collider)
 {
  Character character = (Character) collision.collider;

  character.getEffects().applyAll(effects);
 }
}


3. Keep a list of all characters #2---
This is just a reverse way of the previous example that does not require casting.

1  
2  
3  
4  
5  
for(Character character : scene.getCharacters())
{
 if(rigidBody.getCollisions().contains(character))
  character.getEffects().applyAll(effects);
}



 73 
 on: 2017-07-19 23:03:15 
Started by BurntPizza - Last post by orange451
Starting to re-implement the gen!



This is going to take a LONG time!

 74 
 on: 2017-07-19 22:15:48 
Started by dime26 - Last post by dime26
Enjoy seeing all of your projects, some great screen shots there! I have followed the Robotability team and see they have some similar lighting which works so well. I will spend some time experimenting with this method and post some screen shots soon, really appreciate the help thanks for taking the time Cheesy

 75 
 on: 2017-07-19 21:50:08 
Started by philfrei - Last post by orange451
Maybe you should have read what I posted:
Quote
After the release of NXT, Jagex plans to phase out the use of the Game Client to free up resources to make further improvements to NXT, rather than continuing to maintain two clients. The timescale for phasing out the Java client will be based on beta data
That's related to RS3, not OSRS. Your article relates to the game engine change of around 2015, where RS3 still used a java client. RS3 and OSRS are two different games. So maybe you should have read what I posted

That game (osrs) is staying java, as that is the sole reason the game exists. The userbase loves the classic feel, and Jagex wants to put as little effort into it as possible while maximizing on their profits.

Both games are coming to mobile though.

 76 
 on: 2017-07-19 21:22:31 
Started by philfrei - Last post by gouessej
Maybe you should have read what I posted:
Quote
After the release of NXT, Jagex plans to phase out the use of the Game Client to free up resources to make further improvements to NXT, rather than continuing to maintain two clients. The timescale for phasing out the Java client will be based on beta data

 77 
 on: 2017-07-19 21:03:14 
Started by philfrei - Last post by orange451
The most popular version of runescape, Old School Runescape ( OSRS ), still uses its 2007 java engine (with some modifications). I would imagine they would be keeping the same engine for the mobile version of OSRS, as it is supposed to be compatible with the desktop version. The OSRS team is too small to write a whole new engine like the RS3 team.

Really funny though, when you put it in perspective... The OSRS team is like 10 people, but their game is more popular (and brings in more money) than the newer Runescape (which costs more).

(I'm still an avid runescape player)

 78 
 on: 2017-07-19 21:00:31 
Started by czak - Last post by edmundo
This game is truly addictive...

i remember this game, when i was kid,
the good old days Smiley

 79 
 on: 2017-07-19 20:40:19 
Started by philfrei - Last post by gouessej
Hi

The current engine isn't written in Java:
http://runescape.wikia.com/wiki/NXT

Runescape used JOGL and JOAL more than ten years ago.

 80 
 on: 2017-07-19 20:10:08 
Started by SteveSmith - Last post by orange451
Nice little demo Smiley I've never used JMonkey before, but it seems like a good little prototyping engine.

Pages: 1 ... 6 7 [8] 9 10
 
Archive (412 views)
2017-04-27 17:45:51

buddyBro (591 views)
2017-04-05 03:38:00

CopyableCougar4 (1049 views)
2017-03-24 15:39:42

theagentd (1082 views)
2017-03-24 15:32:08

Rule (1055 views)
2017-03-19 12:43:22

Rule (1040 views)
2017-03-19 12:42:17

Rule (1029 views)
2017-03-19 12:36:21

theagentd (1170 views)
2017-03-16 05:07:07

theagentd (1125 views)
2017-03-15 22:37:06

theagentd (838 views)
2017-03-15 22:32:18
List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05

SF/X Libraries
by SkyAphid
2017-03-02 06:38:56

SF/X Libraries
by SkyAphid
2017-03-02 06:38:32

SF/X Libraries
by SkyAphid
2017-03-02 06:38:05

SF/X Libraries
by SkyAphid
2017-03-02 06:37:51
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!