Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!

1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!

Nils 762

Member Since 09 Sep 2013
Offline Last Active Nov 28 2013 12:27 AM

Posts I've Made

In Topic: Java2DGame rendering NPC's

26 November 2013 - 02:14 PM

So I managed to spawn NPC's of the same type in multiple locations. But now I'm having trouble updating them correctly. I have a start class(includes game loop), a levelLoader class(where I create and spawn NPC's appropriate for the level), and a seperate class for each NPC(each has it's own spawn and update method. I need to update each NPC from the Start class, but since I created the object in the LevelLoader class I can't update the correct variables of each NPC. I can't spawn the NPC's in the Start class because the LevelLoader class decides which NPC's to spawn depending on the level. I'm not sure if I said this in a very understandable way, but any help would be appreciated.

In Topic: Java2DGame rendering NPC's

25 November 2013 - 12:38 AM

I can see how it could be a strain on a processor if too many of one object were to be created. Also I didn't think about synchronization being a problem in the future. Thanks a lot of your input :)

In Topic: Java2DGame rendering NPC's

25 November 2013 - 12:04 AM

I just want to start off by saying thank you for your help on this. I've been developing this game engine for about 2 weeks now using threads for each character of the game. I was under the impression that by having a multitude of threads I would be able to run the AI's of each character more easily. Each NPC currently has a while loop based off of it's HP level, if it equals, or is below 0, the thread stops. I don't understand though, why not use threads rather than calling an update to each NPC? This might just be me trying to keep from rewritting this engine, but still, honest question.

In Topic: Extreme Beginner Help!

24 November 2013 - 10:35 PM

I was exactly where you are about 6 months ago XD I know the feeling of not knowing where to start.

So far I've only released one text-based game. Currently working on a 2D java based game.

I suggest you start with programming. I started with Java watching a series of tutorial vids. http://thenewboston.org/list.php?cat=31

That'll set you up with a basic understanding of programming.

I also suggest starting with a text-based game to help you memorize and let whatever language you chose soak in a bit.

Best of luck to you!

In Topic: Java2DGame rendering NPC's

24 November 2013 - 09:50 PM

Sorry for my lack of immediate information. I'm a self taught programmer and I've only been doing this for maybe 6 months now. I lack proper terminology. :/

I think I understand most of what you're saying Nerdboy, but I want to be able to have multiple of the same NPC on screen at once, if I render 2 NPC's of the same name won't it only display 1 one of them, or both of them at the same position? I was planning on putting g.drawImage(variables..) in each one of the NPC threads, so they would run independently and I wouldn't run into the problem of them displaying in the same position. Would I still run into this problem if I were to use what you suggested and spawn 2 NPC's of the same type? Another question though, would it be better to use a paint method? Currently I have a BufferStrategy and I'm saying "bs.show" to display Images and I honestly barely know what I'm doing when it comes to graphic displays XD please forgive my lack of knowledge.