Skip to content

abdonmorales/cs312-critters

Repository files navigation

Critters Assignment: Computer Science 312

Spring 2024, Dr. Carol Ramsey (Section TA: Kevin Ayala)

Project Overview

This is a Java-based simulation project where different types of "critters" interact in a grid-based world. The project demonstrates object-oriented programming concepts through an engaging simulation environment.

Features

  • Grid-based world simulation
  • Multiple critter types with unique behaviors:
    • Ant
    • Bird
    • Hippo
    • Longhorn
    • Vulture
    • Stone
  • Real-time visualization of critter interactions
  • Configurable simulation parameters
  • Food spawning and consumption mechanics
  • Mating and reproduction system
  • Combat system between critters

Getting Started

  1. Ensure you have Java installed on your system
  2. Compile the project using your preferred Java IDE or command line
  3. Run the CritterMain class to start the simulation

Project Structure

  • src/ - Contains all Java source files
    • CritterMain.java - Main entry point and GUI implementation
    • Critter.java - Base class for all critter types
    • Individual critter implementations (Ant.java, Bird.java, etc.)
  • bin/ - Compiled class files
  • docs/ - Project documentation

How to Use

  1. Launch the simulation using CritterMain
  2. Use the GUI controls to:
    • Start/Stop the simulation
    • Adjust simulation speed
    • Add/Remove critters
    • Reset the simulation
    • Configure display options

Critter Behavior

Each critter type has unique characteristics:

  • Ant: Moves in a specific pattern
  • Bird: Flies in a particular direction
  • Hippo: Moves slowly and eats food
  • Longhorn: Aggressive behavior
  • Vulture: Scavenges for food
  • Stone: Stationary object

Implementation Details

The project includes several implemented critter classes, each extending the base Critter class. Each critter type implements its own unique behavior through the following methods:

  • getColor() - Defines the critter's visual appearance
  • toString() - Determines how the critter is displayed
  • getMove() - Controls the critter's movement patterns
  • fight() - Defines combat behavior when critters meet

Configuration Files

  • _critters_network_settings.txt - Network configuration
  • _critters_saved_settings.txt - Saved simulation settings

Notes

  • The simulation uses a grid-based world where critters can move, eat, fight, and reproduce
  • Each critter type has unique behaviors and characteristics
  • The GUI provides real-time visualization of the simulation
  • Network features are disabled in this version

About

CS 312 Critters Assignment for Introduction to Programming, Spring 2024

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages