Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3444016
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T08:51:46+00:00 2026-05-18T08:51:46+00:00

I’m writing a very simple Java Game. Let me describe it briefly: There are

  • 0

I’m writing a very simple Java Game. Let me describe it briefly:

  • There are 4 players in a Map.
  • The map is a two-dimensional matrix with a value called “height”
  • The height between 2 nodes is the cost of that edge.
  • Use Dijkstra algorithm to help player navigate from a source to a destination.
  • Four players take turn to make a move. The total move is 8( left top, top, right top…. )
  • If they meets, fight for gold value, otherwise move to their target.
  • As they move, their strength decrease by the height difference between two nodes.
  • … etc

….
The problem that I’m encountering is that the source code is getting longer and complex day by day. And I think I’m using a wrong approach somehow, I feel so tired because of constantly changing the implementation. Here is my approach:

  1. Write out all requirements.
  2. Create all the object that I need with all getter and setter.
  3. Create a static class to test the logic
  4. Create unit test while putting the logic together
  5. Add some more code, then change to code to fit the test
  6. Write a big method that run, then break it down into smaller methods, then write unit test again.
  7. If everything work fine, add more requirements, add more code
  8. Then things are getting complicated because the more code I added, the complexity increases. No longer have time to write unit test because create a test case now requires too much work
  9. Re-design, then change the implementation, go to step 1 again.

I’m come from a C++ background, and I’m only comfortable with writing ‘static’ libraries such as: stack, queue, link-listed, tree… Game is really a big challenging to me, especially I have to use Java. I understand the core programming is the same, so picking up Java was not really that bad. However, the time of looking up Java’s API is not little. Further, the game logic is really hard to write. When this object moves, other object got affected…, so creating test for a method depends on many other methods…etc.
I really need an advice. Could anyone share some experience of how to write a game to me? I only have two weeks left for this assignment. I’m currently have 45 classes now, I feel so lost because the more I wrote the more it gets complex 🙁 !

Best regards,
Chan Nguyen

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T08:51:47+00:00Added an answer on May 18, 2026 at 8:51 am

    First start thinking like a java programmer. Think as every thing in your game as an object, like the board, think about the properties and methods it has, its interfaces, how it interacts with the other objects.
    If you need help getting started here is a great tutorial that guides you step by step to do a simple java game, this might put you in the right frame of mind to start programming your own. I strongly recommend you to follow the tutorial.http://www.cokeandcode.com/asteroidstutorial and to use the libraries that they used for developing the interfaz there.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
Seemingly simple, but I cannot find anything relevant on the web. What is the
I have just tried to save a simple *.rtf file with some websites and
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
Does anyone know how can I replace this 2 symbol below from the string
this is what i have right now Drawing an RSS feed into the php,
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
I have a French site that I want to parse, but am running into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.