Win a copy of Securing DevOps this week in the Security forum!

Alix Ollivier

Ranch Hand
+ Follow
since Jun 04, 2012
Alix likes ...
Java Linux Mac
Beijing, China
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Alix Ollivier

Makes sense. I'll try it. Is it because when I delete multiple, the ArrayList size changes and it no longer reaches a point where it is looking for an object, but doesn't have any?
4 years ago
Alright, I tried using the ListIterator, and I seem to have another bug. I can shoot one enemy, and have it disappear. However, if I shoot another, then I get a ConcurrentModificationException

4 years ago
Alright thanks Steve. I'll try doing the ListIterator thing, cause I did get that exception you mentioned.

As for the design thing, I'm still learning. I'll probably use that next game. The main reason that I have an EntityList is because I have an abstract class Entity, and I don't want to have all of the different ArrayLists in the constructor. Not sure if I'm doing it right...
4 years ago
So how would I make the Enemy in the ArrayList null?
4 years ago
@Henry:

Minecraft is a game made in java by a man named notch.

It's basically LEGO in a video game. You go around building things, and harvesting resources from the ground. This is where it got it's name from: Mine + Craft

It's quite addictive.
4 years ago
Hi all. I'm building a game, and I'm having trouble making bullets destroy enemies, I believe because of references.

I have an ArrayList with all the Entities in the game inside. When I create a bullet, each update loop it checks each of the objects in the ArrayList, then if they are an enemy, and they intersect, I'm trying to delete the enemy object.



This is the part where I am having trouble. Up to the part where I print out the message of DEBUG, everything seems to work. However, the enemy doesn't go away when I make it equal to null. Is this because I'm not actually calling upon the enemy, or is it because null takes a while to remove the object, or what?

Thanks in advance.
4 years ago
Ah. Thanks.
4 years ago
How come when I increment a float by 0.01 each update, this is what appears when I system.out.println the value of the float?

0.02
0.03
0.04
0.049999997
0.059999995
0.06999999
0.07999999
0.08999999
0.09999999
0.109999985
0.11999998
0.12999998
0.13999999
0.14999999
0.16
0.17
0.18
4 years ago
Just saying, Swing is terrible for games. It's meant for UIs, and cannot work well on more complex games. If you want to make more 2d games, may I suggest making your next game in Slick2d? http://www.slick2d.org/ It's a free game library based on Opengl, so it is a lot faster, and does all the little parts you don't want to do.
4 years ago
I want to convert my eclipse project into a .app, or a runnable jar. When I try runnable jar, it gives me "Exception in thread "main" java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path"

Anyone know a good tutorial or something?
I guess what I'm asking is "How can I activate an upper class's methods through a lower class?"
5 years ago
I'm assuming reference is the first part of the following?:

Polygon polygon = new Polygon();
5 years ago
I have a main class called GameStart. Now, in video games, in order to hold the different types of scenes, like menu, actual gameplay, cutscenes, and etc, you have things called states. Each state is an individual set of code that is not affected when it is not on. When I start GameStart, it automatically switches to my first state, MenuState. When I am done with the menu, and the player clicks the "continue" button, I want MenuState to tell GameStart to switch the state to GameplayState. I would do it in MenuState if I could, but the only thing I could find in the library I am using is something to leave the state, but nothing to switch them. And I also can't just tell GameStart to update until it gets a leave notification, because the update() method in GameStart is a final protected method, and I don't want to change the source code of my library.
5 years ago