GameIOExample

import java.util.Scanner; public class GameIOExample { public static void main(String[] args) { System.out.println("Please press the Enter key to start."); Scanner readInput = new Scanner(System.in); String keyPress = readInput.nextLine(); if(keyPress.equals("")) { System.out.println("Long, long ago, you decided that you wanted to make video games. You weren't sure how to reach your goal. \nThen one day you heard about this game jam. Congratulations! You are now on your way to becoming a game developer!"); } } }
In this snippet, we take a first look at how to get input and output in Java. This is our first step to creating an interactive game.

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.