Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (710)
Games in Android Showcase (212)
games submitted by our members
Games in WIP (784)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Game Development / Game Mechanics / Re: Removing Projectiles on: 2013-03-24 23:43:48
That causes the game to crash the when the projectile is added rather than when it is removed. :/

Edit: I switched using straight up Arrays and Longor's method and now it works! Using an Array also drastically increased performance, now my tick timer is all messed up. Thanks to everyone who helped!
2  Game Development / Game Mechanics / Re: Removing Projectiles on: 2013-03-24 23:28:16
Originally the remove was being called from inside the projectiles instance, but then I changed it using the flag method suggest by Agro. That didn't work either. The two instances in which the projectile is removed from the screen is when it leaves the viewing screen and when it hits the player or the AI (depending on who originally shot it). The collision detection is in the loop that I showed in the original post. I'm using
to remove the projectile.
3  Game Development / Game Mechanics / Re: Removing Projectiles on: 2013-03-24 23:03:45
The concurrent modification exception still happens.  Undecided
4  Game Development / Game Mechanics / Removing Projectiles on: 2013-03-24 18:43:49
I'm making a game kind of like Super Smash Bros. One of the attacks available to the player is a projectile fireball. All the fireball animation and collision is working perfectly, but whenever the code goes to remove a projectile from the screen, I get the following exception:
Exception in thread "main" java.util.ConcurrentModificationException
        at java.util.AbstractList$Itr.checkForComodification(
        at java.util.AbstractList$
        at Main.<init>(
        at Main.main(

I'm using the following code for looping and removing:
//looping, this is inside the class that draws everything
for(Attack a: projectiles)
//removing this is inside the projectile class
public void removeFromWorld()

Currently I'm using an ArrayList to hold all the projectile data. Would it help if I used a different type of array or made a flag in the projectile class that indicated that the projectile should no longer be updated/drawn?

Thanks for the help!
5  Game Development / Newbie & Debugging Questions / Re: Graphics on: 2012-02-22 17:17:41
To elaborate, I want to draw images into a JFrame or JPanel.
6  Game Development / Newbie & Debugging Questions / Graphics on: 2012-02-21 18:53:24
I have everything about my game down except graphics. So I would like to know an effective way to implement them.
I don't want you use anything fancy like lwjgl so please just natural to Java.

Pages: [1]
theagentd (92 views)
2017-02-18 13:42:33

theagentd (96 views)
2017-02-18 13:35:16

h.pernpeintner (1261 views)
2017-01-24 22:39:11

h.pernpeintner (1250 views)
2017-01-24 22:38:32

Galdo (1808 views)
2017-01-12 13:44:09

Archive (1914 views)
2017-01-02 05:31:41

0AndrewShepherd0 (2452 views)
2016-12-16 03:58:39

0AndrewShepherd0 (2295 views)
2016-12-15 21:50:57

Lunch (2374 views)
2016-12-06 16:01:40

ral0r2 (2155 views)
2016-11-23 16:08:26
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 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‑
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!