Tom-and-Jerry Catching Game Platform Prototype Presentation - - PowerPoint PPT Presentation

tom and jerry
SMART_READER_LITE
LIVE PREVIEW

Tom-and-Jerry Catching Game Platform Prototype Presentation - - PowerPoint PPT Presentation

Tom-and-Jerry Catching Game Platform Prototype Presentation Introduction A* Search? Depth-First Search? Breadth-First Search? What is Tom-and-Jerry? A Java framework. TJ Framework Users input Visualization Predefined methods and


slide-1
SLIDE 1

Tom-and-Jerry

Catching Game Platform

Prototype Presentation

slide-2
SLIDE 2

Introduction

slide-3
SLIDE 3

Depth-First Search? Breadth-First Search? A* Search?

slide-4
SLIDE 4

▷ A Java framework.

What is Tom-and-Jerry?

TJ Framework

User’s input Visualization Predefined methods and classes

slide-5
SLIDE 5

Overview

slide-6
SLIDE 6

The World

slide-7
SLIDE 7

The World

slide-8
SLIDE 8

Class Diagram

User’s package

MyJerry MyTom Game Jerry Tom Agent Cheese Graphic GridCell GridGraph World Movable

Framework

slide-9
SLIDE 9

World Game User Graphic

slide-10
SLIDE 10

import TJPackage.Jerry; public class MyJerry extends Jerry{ public MoveDirection move(){ Random rand = new Random(); MoveDirection randDirection; randDirection = MoveDirection.values()[rand.nextInt(5)]; return randDirection; } }

MyJerry Class

User’s Input

slide-11
SLIDE 11

Core Components

slide-12
SLIDE 12

Creating The Maze

▷ The world consists of rows x columns cells ○ Ex. 4x4 world will have 16 cells. ○ Each cell is a node in the graph ▷ Initially, all cells are walled up.

slide-13
SLIDE 13

Disjoint Set

▷ A set containing subsets of joined elements

{1,2,3,4,5,6,7}

join 2&3

{1,{2,3},4,5,6,7}

join 4&6

{1,{2,3},{4,6},5,7}

join 2&4

{1,{2,3,4,6},5,7}

slide-14
SLIDE 14

The Main Loop

while(!gameConditionSatisfied()) for(Agent agent: agentList){ if(agent instanceof Movable){ MoveDirection direction = ((Movable)agent).move(); updateAgentLocation(agent, direction); } } }

slide-15
SLIDE 15

Game Class

Game

+ setJerry(Jerry): void + setTom(Tom): void + setDimension(int,int): void + setDifficulty(Difficulty): void + setCheeseNumber(int): void + randomNewMaze(): void + play(): void

slide-16
SLIDE 16

import TJPackage.Game; public static void main(String[] args){ Game.setJerry(new MyJerry()); Game.setTom(new MyTom()); Game.setDifficulty(Difficulty.HARD); Game.setDimension(5, 5); Game.setCheeseNumber(1); Game.play(); }

User Interface

slide-17
SLIDE 17

Demonstration