Presentation is loading. Please wait.

Presentation is loading. Please wait.

How to Create a Videogame By: Connor McCann. Java Java is one of many programming languages Java is used to run web browsers and most PC video games I.

Similar presentations


Presentation on theme: "How to Create a Videogame By: Connor McCann. Java Java is one of many programming languages Java is used to run web browsers and most PC video games I."— Presentation transcript:

1 How to Create a Videogame By: Connor McCann

2 Java Java is one of many programming languages Java is used to run web browsers and most PC video games I am definite that everyone in this room has at least one computer with Java running in their home

3 Eclipse is a programming software It is what I will be using in this presentation It can be used to program Java scripts as well as Android apps.

4 Getting Started When you start eclipse you will be required to open a file, to do this all you need to do is make a new file on your desk top, name it whatever you want. You will then need to select a series of settings, from those settings eclipse will start by making you a main ‘Class’. Classes are stored in packages

5 Classes In Java a ‘Class’ is a group of methods that do a specific task For example, a character in a video game is a class The main class could be named “main.java”

6 Methods Methods are used in ‘Classes” to do a specific function EXAMPLE: Make a character move EXAMPLE OF METHOD START: public void charjump(); A method must be called EXAMPLE CALLING A METHOD: charjump();

7 Variables, Floats and Booleans Variable are used to hold a value, such as an enemy ID Floats are used in some numbers, you may need to ‘cast’ a number as a float. To do this just put an ‘f’ after the number (i.e. 5.0f) Booleans are a type of variable that need a true or false response. One example of this is checking if the player is on the ground.

8 Declarations To use ‘Variables’, ‘Floats’, ‘Booleans’ or basically anything else, you will need to make declarations To make a declaration, go to the top line then hit enter twice EXAMPLE DECLARATION: “public int i;” “ i = x;” ‘i’ represents the integer, ‘x’ represents a solid number, the word ‘public’ means it can be used in any class and the word ‘int’ is short for integer. This statement declares an integer and sets its value.

9 Init Init is the most important method of making a video game because it initializes the game. Here is where you call anything you’ll need for the game to run, Timers, Health Checkers, Enemy AI’s, etc.

10 If Statements and For Loops If statements are used in a method to tell it to only use a chuck of code if something happens Example of IF statement If i !== 10 && i > 0 then{ –i++ –}–}. For Loops tell the game to do a chunk of code for an entire array (a group of numbers)

11 Draw. Draw is used to make lines, shapes or occasionally images appear on the game screen. Draw requires many specific ‘parameters’ to do its job. Parameters are used to tell a method additional things it will need. Draw is classified as a function

12 Math Math is a large part of programming and video games Math used to call many functions EXAMPLES Math.RANDOM Math.cos Math.sin

13 E X TRA TIPS Keep things simple when your going to test stuff (i.e. If you want to test a boss, make the way to it easy while you test, make it hard later) Avoid making too much work for yourself Keep the code organized Also code is extremely picky, If you even miss one semi-colon, you will get an:

14


Download ppt "How to Create a Videogame By: Connor McCann. Java Java is one of many programming languages Java is used to run web browsers and most PC video games I."

Similar presentations


Ads by Google