Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (702)
Games in Android Showcase (203)
games submitted by our members
Games in WIP (775)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: 1 ... 7 8 [9] 10
 81 
 on: 2016-12-05 19:14:06 
Started by Opiop - Last post by ziozio
It depends on the file type, I don't know of a library that does a wide variety of formats but most formats are not th.at difficult to write a reader yourself. There may be something I don't know of course

 82 
 on: 2016-12-05 18:56:50 
Started by ziozio - Last post by ziozio
Ndnwarrior15,

I do a similar thing to what you are doing. I have a single texture and have a maximum size of the vbo which I set at the beginning. The issue with a text editor type of scenario is that at some point I will get to the end of the vbo and I will require more space. The obvious thing to do is have multiple vbo's and to keep adding more as the text grows.

I am after some views / ideas / suggestions for alternative ways to the above, I am not familiar with enough later 3.0 functions and 4.0 functions to know if there more optimal ways of doing this

 83 
 on: 2016-12-05 18:14:52 
Started by Opiop - Last post by Opiop
Is there an existing solution to pull artist metadata from a Java File? I would like to strip the artist name, length of track, etc... from a file, an initial Google search didn't turn up too many good solutions and I figured some of you guys might have an idea. I've only seen Apache Tika, seems like it might work but I wanted to get other opinions first.

 84 
 on: 2016-12-05 17:48:26 
Started by MrPork - Last post by VoidBuffer
In addition to the discussions above, you could also replace the first for loop with an Iterator that removes from your list, just like your second for loop. See the following: http://stackoverflow.com/questions/18448671/how-to-avoid-concurrentmodificationexception-while-removing-elements-from-arr

 85 
 on: 2016-12-05 17:30:41 
Started by bmanmcfly - Last post by VoidBuffer
Are you talking about the Universal Tween Engine(aurelienribon), or the built in tween engine within libgdx(Interpolation)? Either way I personally haven't come across a use case for either yet that wasn't something I could have easily done myself or through Actors. In your example of using tweening for screen's, this is something you could achieve with the built in Actors which have Actions. For example I use Actor.Actions in order to fade/move/rotate various entities. For example the fading effect on my splash screen is simply:

1  
splashImage.addAction(Actions.sequence(Actions.alpha(0), Actions.fadeIn(FADE_TIME), Actions.delay(FADE_TIME)));


So you can get away with a lot in terms of just using the Actors within LibGDX without having to worry about using a tween engine.

For your second question, this really just depends on how you want to approach your design. I don't personally use tweens for player movement, but instead move a player around by their Vector2 position, which is variable of Vector2 velocity. From there I can modify the players position by adjusting their position.x and position.y, likewise with velocity. If your moving via velocity, you can add that to your position data as such:

1  
position.add(velocity.cpy().scl(Gdx.graphics.getDeltaTime() * SPEED)); // Updating position of player


I hope that helps Smiley This post was a bit broad so I kind of pulled out my shotgun and spray fired a little.

 86 
 on: 2016-12-05 10:04:33 
Started by MrPork - Last post by VaTTeRGeR
Quote
If you still get ConcurrentModException, you are iterating over itemList somewhere else  Smiley

That is the most plausible cause if the issue still persists after replacing the first loop with "itemList.clear();"

His second loop looks correct to me, only thing that is redundant is the "if(!MapManager.isLoading)" statement because the loop gets executed anyway, "MapManager.isLoading" always gets set to false in the first block when it is true in the beginning.

 87 
 on: 2016-12-05 09:45:34 
Started by MrPork - Last post by h.pernpeintner
You (ususally) cannot remove objects from a collection you are currently iterating over. If you want to clear a list completely, use .clear(). Otherwise, create a list where you collect references to the entitites you want to delte in a first iteration and delete them in a second iteration with .remove(entity).

To be more precise:


for(int i = 0; i < itemList.size(); i++){
  itemList.remove(i);
}

can be replaced with itemList.clear();


If you still get ConcurrentModException, you are iterating over itemList somewhere else Smiley

 88 
 on: 2016-12-05 09:41:21 
Started by MrPork - Last post by VaTTeRGeR
Does the first loop work correctly?

Say you have 2 items in that list:
1  
2  
iteration 1: i = 0; itemList.size()=2 -> remove 0
iteration 2: i = 1; itemList.size()=1 -> does not get executed, one item left!


So shouldn't it be:

1  
2  
3  
for(int i = itemList.size() - 1; i >= 0; i--) {
    itemList.remove(i);
}


or

1  
itemList.clear();


 89 
 on: 2016-12-05 07:13:57 
Started by bornander - Last post by Stampler
It may sound weird, but I somehow feel that the home-, x- and play button are too "edgy". They just don't look very smooth according to my eyes (Sorry, I'm a petty person). About the fancy part, I would just try to change the color a bit. Maybe some orange/red to still stand out from the level enviroment.

Aside from pointing out irrelevant things no one else probably cares about, I found a few bugs:
  • In the 4th world (pink alien) level 5 and 6 are exactly the same
  • My game crashes when I want to start the last level in the last world(yellow alien)

 90 
 on: 2016-12-05 06:02:24 
Started by MrPork - Last post by MrPork
I created a simple system to change levels. Upon reaching level 2 I get a concurrent modification error any time I try to erase all the objects in my list. Using an iterator doesn't work, using ArrayList.clear() doesn't work either. Iv'e exhausted all my options as a nub, what gives?

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  
public void update(float delta){
     
      if(MapManager.isLoading){
         
         for(int i = 0; i < itemList.size(); i++){
            itemList.remove(i);
         }
         
         MapManager.isLoading = false;
         
      }
     
   if(!MapManager.isLoading){
      for(Iterator<Item> itemIter = itemList.iterator(); itemIter.hasNext();){
         Item item = itemIter.next();
         item.update(delta);
         
         if(!item.isAlive()){
            itemIter.remove();
         }
         
         if(EntityManager.playerReference.getRectangle().overlaps(item.getRectangle())){
            item.doSomething();
         }
         
          }
      }
   }
   
}

Pages: 1 ... 7 8 [9] 10
 
Lunch (74 views)
2016-12-06 16:01:40

ral0r2 (299 views)
2016-11-23 16:08:26

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

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

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

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

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

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

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

Roquen (471 views)
2016-10-22 01:57:43
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!