SZD/ 02
中文
SZD/ 02 PROJECTS
中文

Research index

Course Project / SI100B: Introduction to Information Science and Technology

SAVE MY LINEAR ALGEBRA: A Pygame Roguelike

A team-based Pygame final project for SI100B: Introduction to Information Science and Technology.

SI100B: Introduction to Information Science and Technology · ShanghaiTech University · 2024 Fall

  • SI100B: Introduction to Information Science and Technology
  • Pygame
  • Python
  • 2D Roguelike Game
  • Course Project
  • Scene Design
  • Collision System
  • NPC Dialogue
Cropped gameplay cover showing the GURDY boss encounter.
Optimized cover: centered boss-room gameplay crop used across the project cards and detail page.

SI100B

Overview

SAVE MY LINEAR ALGEBRA is the final project for SI100B: Introduction to Information Science and Technology. The game is a Pygame roguelike prototype inspired by The Binding of Isaac: the player controls Isaac, shoots tears, plants bombs, clears monsters, collects rewards, talks to NPCs, and ultimately defeats the boss. Isaac has limited health, so the game ends when HP reaches zero.

Summary

  • The work is presented as a SI100B course final project rather than a commercial game.
  • The game prototype and visual materials are explicitly inspired by The Binding of Isaac.
  • Core play combines room exploration, shooting, bomb placement, monster clearing, NPC rewards, and a final boss fight.
  • The report authors are listed as 潘佑邦, 宋梓冬, and 吴俊阳.
Screenshot of the GURDY boss room with health UI and boss-room hint.
Project screenshot: GURDY boss encounter with health, resources, and boss-room hint.

Gameplay Design

The player loop is organized around room exploration and combat: Isaac starts from StartRoom, learns the controls, enters reward or combat rooms, unlocks doors by clearing enemies, and follows the boss-room hint toward the final encounter.

Gameplay

Player control

  • W, A, S, and D move Isaac, with diagonal movement represented through the movement vector.
  • Arrow keys fire tears in different directions, and tear attack can be strengthened during play.
  • LShift accelerates movement, while E plants bombs that can damage enemies and also hurt Isaac.

Gameplay

Room progression

  • StartRoom introduces movement, attack, and bomb placement.
  • Combat rooms close their doors during fights and reopen after all enemies are killed.
  • Each run contains one BossRoom, and defeating the boss enters the win scene.

Gameplay

Rewards and failure state

  • Lucky Room provides a raffle machine that consumes coins and grants health, attack, or coin rewards.
  • NPC Room lets players talk with Trainer or Merchant for hidden rewards or trades.
  • Isaac dies and the game ends when health is depleted.

Implementation Design

The implementation covers room scenes, door logic, obstacles, camera-like transitions, character behavior, a binary-tree map structure, collision handling, resource UI, NPC decision logic, menu scenes, and audio feedback.

System

Scenes, doors, and transitions

  • The game uses StartRoom, reward rooms, combat rooms, and one BossRoom.
  • Doors can appear on four sides, and door types determine the next room type.
  • Room switching uses transition animation with a camera-follow effect between scenes.

System

Map and room generation

  • A binary tree stores the room structure, with StartRoom as the root.
  • The map extends rightward and downward for four layers, producing 15 rooms.
  • The BossRoom is guaranteed to appear on the fourth layer, and each node keeps parent and child information for iteration and backtracking.

System

Obstacles and collision

  • Rooms include Rock and Shit obstacles with different destruction rules.
  • Combat rooms randomize Rock positions and Shit patterns.
  • Collision handling covers player-scene, projectile-scene, projectile-enemy, player-enemy, NPC, and item interactions, including pixel-level mask collision.

System

NPC, resources, and feedback

  • Trainer asks math questions and can heal Isaac or strengthen attack patterns.
  • Merchant trades coins or HP for healing, bombs, attack boosts, and attack-speed boosts.
  • Health, coins, attack, bombs, and boss-room hints are updated in the UI, while actions trigger animations and sounds.
Diagram of the binary-tree room generation structure.
Design diagram: binary-tree room structure from Start Room to Boss Room.

Design Notes

The project design includes scenes, doors, obstacles, collisions, character logic, NPC dialogue, resources, UI, menu animation, BGM, and hidden effects.

Report

Character and boss design

  • Normal enemies move around and damage the player on collision.
  • Bug has normal and sprint states, while Fly moves irregularly.
  • Gurdy has 100 HP, summons flies, fires bullets toward the player, and is implemented with separated body and attack classes.

Report

NPC / LLM agent system

  • Players approach NPCs and press Q to enter the chatbox.
  • Dialogue history and current player state are passed into the NPC decision process.
  • Trainer and Merchant produce different rewards, penalties, or trades based on dialogue and resources.

Report

UI, hints, and hidden effects

  • The UI updates health, coin, attack, and bomb values in real time.
  • A boss-room hint helps the player infer the path to the BossRoom.
  • Bomb self-damage can trigger a hidden split-body effect where Isaac’s head floats irregularly.

Report

Code organization

  • The report describes modular object-oriented implementation.
  • GameManager acts as the main control module, while Characters, Scenes, TmpTools, and UI folders separate responsibilities.
  • Main.py and Statics.py are placed at the project root for running and shared data.

My Contribution

My contribution focused on enemy logic, game management, animations, UI/scenes, and README documentation as part of the team project.

Contribution

  • Enemies.py
  • GameManager.py
  • Animations
  • UI / Scenes
  • README.md

Visual Gallery

Selected in-game screenshots and design diagrams from the project materials are shown below.