đź’ż
CS61B Fall 2022
  • CS61B Fall 2022
  • Prerequisites to running the assignments.
  • Lab 01: Setting up your computer
  • Lab 02: JUnit Tests and Debugging
  • Project 0: 2048
  • Lab 03: Timing Tests and Randomized Comparison Tests
  • Lab 04: A Debugging Mystery
  • Project 1: Deques
  • HW 2: Percolation
  • Lab 07: BSTMap
  • Project 2a: NGordNet (NGrams)
  • Lab 08: HashMap
  • Project 2b: NGordNet (WordNet)
  • Lab 11: BYOW Introduction
  • Project 3 BYOW
    • Phase 1: World Generation
Powered by GitBook
On this page
  • Overview
  • Skeleton Code Structure

Project 3 BYOW

An open-ended project, where students implement their own engine for generating explorable worlds.

PreviousLab 11: BYOW IntroductionNextPhase 1: World Generation

Last updated 1 year ago

to running the code.

Instructions:

Solution (Phase 1):

The project was divided into 2 phases:

  • Phase 2: Interactivity

Overview

Your task for the next few weeks is to design and implement a 2D tile-based world exploration engine. By “tile-based”, we mean the worlds you generate will consist of a 2D grid of tiles. By “world exploration engine” we mean that your software will build a world, which the user will be able to explore by walking around and interacting with objects in that world. Your world will have an overhead perspective.

Skeleton Code Structure

As always, use git pull skeleton main to pull the skeleton code. The skeleton code contains two key packages that you’ll be using: byow.TileEngine and byow.Core. byow.TileEngine provides some basic methods for rendering, as well as basic code structure for tiles, and contains:

  • TERenderer.java - contains rendering-related methods.

  • TETile.java - the type used for representing tiles in the world.

  • Tileset.java - a library of provided tiles.

IMPORTANT NOTE: Do NOT change TETile.java’s character field or character() method as it may lead to bad autograder results.

The other package byow.Core contains everything unrelated to tiles. We recommend that you put all of your code for this project in the byow.Core package, though this not required. The byow.Core package comes with the following classes:

  • RandomUtils.java - Handy utility methods for doing randomness related things.

  • Main.java - How the user starts the entire system. Reads command line arguments and calls the appropriate function in Engine.java.

  • Engine.java - Contains the two methods that allow interacting with your system.

byow.Core.Engine provides two methods for interacting with your system. The first is public TETile[][] interactWithInputString(String input). This method takes as input a series of keyboard inputs, and returns a 2D TETile array representing the state of the universe after processing all the key presses provided in input (described below). The second is public void interactWithKeyboard(). This method takes input from the keyboard, and draws the result of each keypress to the screen. Lab 11 covers how to render tiles, and Lab 12 covers how to get user input.

Your project should only use standard java libraries (imported from java.*) or any libraries we provided with your repo. Your final submission for the Phase 2 Autograder and Checkoff should not use any external libraries other than the ones provided in the skeleton.

IMPORTANT NOTE: Do NOT use static variables unless they have the final keyword! In 2018, many students ran into major debugging issues by trying to use static variables. Static non-final variables add a huge amount of complexity to a system. Additionally, do not call System.exit() in interactWithInputString as this will cause the autograder to exit and fail.

This project makes heavy use of StdDraw, which is a package that has basic graphics rendering capabilities. Additionally, it supports user interaction with keyboard and mouse clicks. You will likely need to consult the API specification for StdDraw at some points in the project, which can be found .

Prerequisites
https://fa22.datastructur.es/materials/proj/proj3/
https://github.com/tomthestrom/cs61b/tree/master/proj3
Phase 1: World Generation
here