Index

A B C D E F G H I J K L M N O P R S T U V W X Y 
All Classes|All Packages|Constant Field Values

A

A_Star(Vector2D, Vector2D, Board) - Method in class Pathfinding
Main algorithm.
add(int, int) - Method in class Vector2D
 
add(Vector2D) - Method in class Vector2D
 
add(Vector2D, Vector2D) - Static method in class Vector2D
 
addKeyListener(KeyListener) - Method in class GameBase
Add new key listener.
awake() - Method in class Frog
 
awake() - Method in class GameObject
Like unity Awake (invoke on create of object or create gameplay).
awake() - Method in class Snake
 
awake() - Method in class SnakePlayer
 
awake() - Method in class Wall
 
awakeScene() - Method in class GameBase
Scene awake on open the game.
awakeScene() - Method in class Gameplay
 

B

board - Variable in class Board
 
board - Variable in class Snake
 
Board - Class in <Unnamed>
Class to visualize enviroment in game.
Board - Variable in class Pathfinding
 
Board(int) - Constructor for class Board
Constructor set borders of scene, spawn obstacles and fill empty spaces with cells.
body - Variable in class Snake
 
BOTTOM_TEXT_AREA - Static variable in class Gameplay
 

C

Cell - Class in <Unnamed>
Base to build enviroment.
Cell(int, int) - Constructor for class Cell
 
CELL_HEIGHT - Static variable in class Gameplay
 
CELL_WIDTH - Static variable in class Gameplay
 
CELLS_X - Static variable in class Gameplay
 
CELLS_Y - Static variable in class Gameplay
 
clone() - Method in class Vector2D
 
color - Variable in class Cell
 
color - Variable in class Snake
 
color - Variable in class SnakePart
 
content - Variable in class Cell
 
control() - Method in class Snake
Control of snake depending if it's player od AI
control() - Method in class SnakeAI
This method move snake using pathfinding.
control() - Method in class SnakePlayer
 
cross(int, int) - Method in class Vector2D
 
cross(Vector2D) - Method in class Vector2D
 
cross(Vector2D, Vector2D) - Static method in class Vector2D
 

D

dead() - Method in class Snake
Destroy all snake's parts and destroy snake.
dead() - Method in class SnakePlayer
 
DecreaseCounter() - Method in class FruitGenerator
Decrease counter.
DEFAULT_HEIGHT_OF_WINDOW - Static variable in class GameBase
 
DEFAULT_WIDTH_OF_WINDOW - Static variable in class GameBase
 
DESIRED_DELTA_LOOP - Variable in class GameBase
 
DESIRED_FPS - Variable in class GameBase
 
destroy(GameObject) - Method in class GameBase
Destroy gameobject and invoke OnDestroy().
direction - Variable in class Snake
 
distanceSq(int, int) - Method in class Vector2D
 
distanceSq(Vector2D) - Method in class Vector2D
 
divide(int) - Method in class Vector2D
 
dot(int, int) - Method in class Vector2D
 
dot(Vector2D) - Method in class Vector2D
 
dot(Vector2D, Vector2D) - Static method in class Vector2D
 

E

EndingPosition - Variable in class Pathfinding
 
equals(Object) - Method in class Vector2D
 
equalValue(Vector2D) - Method in class Vector2D
 

F

finish() - Method in class GameBase
Stop and finish main loop.
frame - Variable in class GameBase
 
Frog - Class in <Unnamed>
GameObject which run away from snake.
Frog(Board) - Constructor for class Frog
Constructor pass reference to frog.
Fruit - Class in <Unnamed>
Static GameObject which grants points to Snake after collision.
Fruit(Cell, FruitType, FruitGenerator) - Constructor for class Fruit
Costructor that set position and type of object.
FruitGenerator - Class in <Unnamed>
Class generate fruit on random position.
FruitGenerator(Board, int, float) - Constructor for class FruitGenerator
Constructor pass reference to board, set max fruits quantity and interwals of time between new fruits spawn.

G

game - Static variable in class GameObject
Reference to gameplay.
GameBase - Class in <Unnamed>
Main class of game.
GameBase() - Constructor for class GameBase
Awake of game.
GameObject - Class in <Unnamed>
Game objects class, base of objects on the scenes.
GameObject() - Constructor for class GameObject
 
Gameplay - Class in <Unnamed>
 
Gameplay() - Constructor for class Gameplay
 
gCost - Variable in class Node
 
getAdded(Vector2D) - Method in class Vector2D
 
GetCell(int, int) - Method in class Board
Return cell in position.
GetCell(Vector2D) - Method in class Board
Return cell in position.
GetClosestEmptyCell(Cell) - Method in class Board
Return empty cell closest to cell.
GetClosestFruit(Cell) - Method in class Board
Return fruit closest to origin else return null.
getComponents() - Method in class Vector2D
 
getDeltaTime() - Method in class GameBase
DeltaTime of current frame.
getDeltaTime() - Method in class GameObject
Like Time.deltaTime in Unity.
getDivided(int) - Method in class Vector2D
 
GetFirstEmptyCell() - Method in class Board
Return first empty cell starting from (0,0) else return null.
getGameObjects() - Method in class GameBase
Get gameobjects in gameplay.
getLength() - Method in class Vector2D
 
getLengthSqrt() - Method in class Vector2D
 
getMultiplied(int) - Method in class Vector2D
 
getNormalized() - Method in class Vector2D
 
getPerp() - Method in class Vector2D
 
GetRandomEmptyCell() - Method in class Board
Return random empty cell on board.
getReversed() - Method in class Vector2D
 
getSubtracted(Vector2D) - Method in class Vector2D
 

H

hCost - Variable in class Node
 
Head() - Method in class Snake
Return head of the snake.
height - Variable in class Sprite
 
HEIGHT_OF_WINDOW - Static variable in class Gameplay
 

I

image - Variable in class Sprite
 
initialize(GameObject) - Method in class GameBase
Initialize gameobject on gameplay.

J

JavaSnake - Class in <Unnamed>
Main class of the program.
JavaSnake() - Constructor for class JavaSnake
 

K

keyPressed(KeyEvent) - Method in class SnakePlayer
 
keyReleased(KeyEvent) - Method in class SnakePlayer
 
keyTyped(KeyEvent) - Method in class SnakePlayer
 

L

loadImage(String) - Method in class Sprite
 

M

main(String[]) - Static method in class JavaSnake
 
ModeLeft() - Method in class Snake
Set snake direction to the left.
MoveDown() - Method in class Snake
Set snake direction downwards.
MoveRight() - Method in class Snake
Set snake direction to the right.
MoveUp() - Method in class Snake
Set snake direction upwards.
multiply(int) - Method in class Vector2D
 

N

newPartsNumber - Variable in class Snake
 
Node - Class in <Unnamed>
Store information about cells cost for A* pathfinding algorithm.
Node(Vector2D, Vector2D, int, int) - Constructor for class Node
Basic constructor to set field.
normalize() - Method in class Vector2D
 

O

onDestroy() - Method in class Frog
 
onDestroy() - Method in class Fruit
 
onDestroy() - Method in class GameObject
Like unity OnDestroy (invoke after destroy object or on end of game).
onDestroy() - Method in class Snake
 
onDestroy() - Method in class SnakeAI
 
onDestroyScene() - Method in class GameBase
Destroy scene after game objects.
openWindow(int, int, String) - Method in class GameBase
 

P

parentPosition - Variable in class Node
 
Pathfinding - Class in <Unnamed>
Implementation of A* algorithm to find best path.
Pathfinding(Vector2D, Vector2D, Board) - Constructor for class Pathfinding
Start game button action.
points - Variable in class Snake
 
position - Variable in class Cell
 
position - Variable in class Node
 
position - Variable in class SnakePart
 

R

Random - Class in <Unnamed>
Class to return random values in range.
Random() - Constructor for class Random
 
Range(int, int) - Static method in class Random
 
render(Graphics2D) - Method in class Cell
 
render(Graphics2D) - Method in class Frog
 
render(Graphics2D) - Method in class Fruit
 
render(Graphics2D) - Method in class GameObject
Method who render a object on screen (invoke on begin of each frames).
render(Graphics2D) - Method in class SnakeAI
 
render(Graphics2D) - Method in class SnakePart
 
render(Graphics2D) - Method in class SnakePlayer
 
render(Graphics2D) - Method in class Sprite
 
renderScene(Graphics2D) - Method in class GameBase
Render scenes before game objects.
Result - Variable in class Pathfinding
 
reverse() - Method in class Vector2D
 
run() - Method in class GameBase
Main loop of game.
run() - Method in class Pathfinding
Run the algorithm.

S

set(int, int) - Method in class Vector2D
 
set(Vector2D) - Method in class Vector2D
 
setTimer(float) - Method in class GameObject
Set timer in milliseconds.
setZero() - Method in class Vector2D
 
Snake - Class in <Unnamed>
GameObject that implements snake.
Snake(Board) - Constructor for class Snake
Constructor pass reference to board.
SnakeAI - Class in <Unnamed>
Class of snake AI.
SnakeAI(Board) - Constructor for class SnakeAI
Constructor that pass reference to board.
SnakePart - Class in <Unnamed>
GameObject to build snake.
SnakePart(Vector2D, Color) - Constructor for class SnakePart
Constructor to set initial positions and color.
SnakePlayer - Class in <Unnamed>
Snake which can be move by player.
SnakePlayer(Board) - Constructor for class SnakePlayer
Pass the reference to board.
Sprite - Class in <Unnamed>
 
Sprite() - Constructor for class Sprite
 
start() - Method in class Frog
 
start() - Method in class FruitGenerator
 
start() - Method in class GameObject
Like unity Start (invoke on first frame of object like or before begin main loop).
start() - Method in class Snake
 
StartingPosition - Variable in class Pathfinding
 
startScene() - Method in class GameBase
Invoke before main loop.
subtract(int, int) - Method in class Vector2D
 
subtract(Vector2D) - Method in class Vector2D
 
subtract(Vector2D, Vector2D) - Static method in class Vector2D
 

T

timer - Variable in class GameObject
Timer value.
TIMER_BASE_VALUE - Variable in class Snake
 
timerClockDown() - Method in class GameObject
Clock down timer.
toString() - Method in class Vector2D
 
type - Variable in class Fruit
 

U

update() - Method in class Frog
 
update() - Method in class FruitGenerator
 
update() - Method in class GameObject
Like unity Update (invoke after render on each frames).
update() - Method in class Snake
 
updateScene() - Method in class GameBase
Update scene before game objects.

V

Vector2D - Class in <Unnamed>
Class that implements 2D Vector with methods to do basic calculations.
Vector2D() - Constructor for class Vector2D
 
Vector2D(int, int) - Constructor for class Vector2D
 
Vector2D(Vector2D) - Constructor for class Vector2D
 

W

Wall - Class in <Unnamed>
Class to implement wall as obstacle.
Wall(int, int) - Constructor for class Wall
Set wall positions.
width - Variable in class Sprite
 
WIDTH_OF_WINDOW - Static variable in class Gameplay
 

X

x - Variable in class Sprite
 
x - Variable in class Vector2D
 

Y

y - Variable in class Sprite
 
y - Variable in class Vector2D
 
A B C D E F G H I J K L M N O P R S T U V W X Y 
All Classes|All Packages|Constant Field Values