Jump to content
  • Advertisement

Nils 762

  • Content Count

  • Joined

  • Last visited

Community Reputation

130 Neutral

About Nils 762

  • Rank
  1. I'm currently working on a 2D java game. I'm saving each active NPC(each NPC has a class file, extedning an abstract NPC class) from the game in a list(array) and itterating it to display the NPC using one of it's methods. The problem that I've run into is that I can't find a way to delete the NPC from the list when it's HP level is <= 0. I'm sure there is probably a really simple way to do this that someone more experienced would be aware of.     PS. This is my first 2D game XD
  2. Nils 762

    Java2DGame rendering NPC's

    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.
  3. Nils 762

    Java2DGame rendering NPC's

    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 :)
  4. Nils 762

    Java2DGame rendering NPC's

    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.
  5. Nils 762

    Extreme Beginner Help!

    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!
  6. Nils 762

    Java2DGame rendering NPC's

    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.
  7. Hey everyone, I'm working on a 2D java game at the moment and have a graphics object created in my start class. I want to be able to draw my NPC's from their own threads(seperate class) but can't load the g.drawImage class from a different class. Any suggestions on how I can transfer the graphics object to the NPC threads? Thanks in advance!
  8. Every user of my game would require the JRE? How would I go about giving them that? I feel like there should be some easier way :/
  9. I've spent the last few months developing a Text-Based Java game and recently completed it. I've compiled all the .java files into .class files and have been able to run it using command prompt. The problem is that other people on their computers cannot run it on their command prompt. I think because they don't have java JDK. So my question is how would I go about compiling my game so that other people can play it easily? Prefferably through a desktop Icon?
  10. Nils 762

    Best method to learn Java?

    Game Dev is an absolutely wonderful base of helpful people :) Thanks everyone, I should've mentioned I've been working on a text-based Java game and have tested my abilities somewhat thouroughly. I'm going to get a couple of books on Java, maybe it'll be a little easier for me. You're all wonderfully helpful people and I'll be sure to use everything suggested. ^.^
  11. Hey guys,   I'm new to GameDev, and programming, and have decided to make the first language I learn Java. So far I've been watching TheNewBoston's tutorials. I've managed to learn a bit about variables, classes, methods, switches, etc. but for some reason am now having trouble understanding new material. :/ What do you think is the absolute best method for learning Java? Especially for designing games(3D).
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!