• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
Mochy Tanauan

HELP: java game in command line

6 posts in this topic

i want to make a commad line type of game like tiny towers in java. just in command line. the gameplay is, a player can add floor and choos whatever type they like, once they choose the type, the player may choose what kind of business it will be. minimum of 6 choices per floorr type. And at the end of the day tenant will pay 100 coins to the player for rent,should be 3 tenants per floor.

Game Play
Players should have access at all times on the status of the tower, floors and the bitizens. A player can add a floor, add bitizens and restock. The game should notify the player if an item is up for restocking so that the player can restock a specific item. A player can choose to end the current day to move to the next one.


please help! thanks in advance!
0

Share this post


Link to post
Share on other sites
I would assume that if you are asking this that your knowledge in programming is fairly little (or maybe, you have never done Java)

As much as we would all love to start with the fun, I would recommend first learning C (if you don't already know it), not C++, but C.
after that, Java is a good language as it is an easy language to start with object orientation. [url="http://docs.oracle.com/javase/tutorial/java/concepts/"]this[/url] is some good theory, for learning java you can look at [url="http://www.javabeginner.com/toc.htm"]this[/url]... finally, once you know how to program in java to a high enough level maybe look into the theory behind the design of a game.. I was inable to find out how difficult making this would be, so I assumed it would be hard enough that making a proper design would be beneficial. you can look at that [url="http://digitalworlds.wordpress.com/2008/04/10/the-process-of-game-creation-the-game-design-document/"]here[/url]

you could also have a look at this:
[CODE]
import java.io.*;
class RockPaperScissors {
BufferedReader BR = new BufferedReader(new InputStreamReader(System.in));
public static void main(String[] args) {
RockPaperScissors RPS = new RockPaperScissors();
System.out.println("Welcome to Rock, Paper, or Scissors!");
System.out.print("Please enter the number of rounds you would like to play : ");
int round = RPS.rounds();
int user = 0;
int computer = 0;
for (int i = 0; i < round; i++) {
if (RPS.choose(i + 1))
user++;
else
computer++;
}
RPS.result(user, computer);
}

void result(int user, int computer) {
System.out.println("RESULTS:");
System.out.println("User wins : " + user);
System.out.println("Computer wins : " + computer);
if (user > computer)
System.out.println("User wins the game!\n");
else
System.out.println("Computer wins the game!\n");
}

int rounds() {
try {
int temp = Integer.parseInt(BR.readLine());
if (temp % 2 == 0)
throw new Exception();
return temp;
}
catch (Exception err) {
System.out.print("Sorry, you need to enter an odd number. Please try again : ");
return rounds();
}
}

boolean choose(int val) {
System.out.print("[Round " + val + "] Rock, Paper, or Scissors? : ");
String input = "";
try {
input = BR.readLine();
}
catch(Exception err) {
}
if (input.equals("Rock"))
return process(1, val);
else if (input.equals("Paper"))
return process(2, val);
else if (input.equals("Scissors"))
return process(3, val);
else {
System.out.println("Sorry, \"" + input + "\" is not a valid entry!\n");
return choose(val);
}
}

boolean process(int user, int val) {
String[] hand = {"", "Rock", "Paper", "Scissors"};
int comp = (int)(Math.random() * 3) + 1;
if (user == comp) {
System.out.println("Computer chooses " + hand[user] + ". It's a tie.\n");
return choose(val);
}
else if (user == 1 && comp == 3) {
System.out.println("Computer chooses " + hand[comp] + ". You win!\n");
return true;
}
else if (user == 2 && comp == 3) {
System.out.println("Computer chooses " + hand[comp] + ". You lose!\n");
return false;
}
else if (user == 1 && comp == 2) {
System.out.println("Computer chooses " + hand[comp] + ". You lose!\n");
return false;
}
else if (user == 3 && comp == 2) {
System.out.println("Computer chooses " + hand[comp] + ". You win!\n");
return true;
}
else if (user == 2 && comp == 1) {
System.out.println("Computer chooses " + hand[comp] + ". You win!\n");
return true;
}
else {
System.out.println("Computer chooses " + hand[comp] + ". You lose!\n");
return false;
}
}
}
[/CODE]
[url="http://www.programmingforums.org/post203062.html"]source[/url]

I can't say if it works or not, but it is a good example as it shows nested loops and an easily implemented game.
I tend to find looking at someone else code easier to make my own.
0

Share this post


Link to post
Share on other sites
Thanks [url="../../user/188408-falconmick/"]falconmick[/url]. Actually I've already learned C. I'm a little bit confuse in making the said game, on how I code to built floors with different types. BTW thanks for the post it really helps.
0

Share this post


Link to post
Share on other sites
break it down into it's smallest pieces..

so, you would have a class called buildingLevel, of which the game at one time would have 6 stored in an array (maybe a map just to speed things up).

once you have done that you break down building level more. split it into it's diferent components, turn each component into a class, then use buildingLevel to link all of the other components into the single buildingLevel component...
0

Share this post


Link to post
Share on other sites
can you give a sample code for building the floors, sorry im just a beginner in java. i need a Floor class, that has an array [] of floor types. Floors can be Residential, Food, Service, Recreation, Retail, or Creative. and what kind of business it will be.
0

Share this post


Link to post
Share on other sites
Your posts so far don't indicate that you have even started on this project yourself. [url="http://mattgemmell.com/2008/12/08/what-have-you-tried/"]What have [u]you[/u] tried[/url]?
2

Share this post


Link to post
Share on other sites
I actually started the project, creating a class for building floors, but I'm really confuse, thinking that I'm doing it wrong. I'm not really good in java, I'm just a beginner in this language so I'm hoping for help. Thanks in advance!
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0