Skip to content

tranhao01/Python-professional-handle-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌌 🎮 Key Features for the Project Your project could go beyond basic starfields and evolve into a fully interactive 3D-style Pygame scene. Some core elements might be:

  • âś… 3D starfield with movement & depth
  • âś… 3D planet and moon rotation (simulate spheres)
  • âś… Camera movement (move forward, backward, look around)
  • âś… User controls for exploration (WASD to navigate, mouse to look)
  • âś… Dynamic lighting (basic shading effects)
  • âś… Comet trails & particle effects
  • âś… Asteroid belt with rotating rocks
  • âś… Scalable “hyperspace jump” effect
  • âś… Smooth frame rates with delta time

Project Starflight: Hyperspace Initiative

Overview

This project is a progressive series of Python programs that simulate 3D space scenes using Pygame. The project evolves from simple 3D starfields and rotating cubes to a sophisticated interactive space simulation with sound, particle effects, and multiple 3D objects. Each file represents a stage in the development, adding new features and complexity.

Project Structure

  • square.py: The starting point. Renders a 3D starfield and a single rotating cube using Pygame. Demonstrates basic 3D projection and animation. image image

  • square2.py: Adds a rotating 3D square alongside the cube, with improved projection and visual separation. Both shapes rotate independently, and the starfield remains as a background. image image

  • square3.py: Introduces user interaction. The cube and square can be rotated and scaled using keyboard controls. The code is refactored for better color management and usability. image image image

  • square4.py: Enhances the scene with a denser starfield, a fog effect, and a 3D ground plane grid. The cube and square now have lighting and perspective improvements. The code structure is more modular, and visual effects are richer. image image

  • square5.py: Major expansion. Adds a class-based architecture for 3D objects, including cubes, pyramids, and a spaceship model. Introduces a particle system for effects like engine trails. The starfield and ground plane are more immersive, and the camera system is more advanced. image image

  • square6.py: Further expands the simulation with asteroids and nebula clouds. The world is larger, the starfield is denser, and the particle and object systems are more robust. The code supports more complex 3D scenes and interactions. image image image

  • square7.py: The most advanced version. Adds sound effects (engine hum, warp activation, impacts) and a targeting system. The simulation includes all previous features: stars, ground plane, 3D objects, asteroids, nebulae, and particles. The code is highly modular and demonstrates advanced Pygame and 3D programming techniques. image image image image image image image image image image

  • sounds/: Contains sound assets used in the latest version:

    • engine_hum.ogg: Background engine hum sound.
    • warp_activate.ogg: Sound effect for warp activation.
    • impact.ogg: Sound effect for impacts or collisions.
  • python project.docx: (Not directly readable here) Presumably contains project documentation, planning, or a report.

  • 200: Empty or placeholder file.

How to Run

  1. Install Python 3.x and Pygame:
    pip install pygame
  2. Run any of the Python files (e.g., python square7.py) to see the corresponding version of the simulation.
  3. For full experience (in square7.py), ensure the sounds/ directory is present with the required .ogg files.

Controls (in advanced versions)

  • Arrow keys: Rotate objects
  • W/S: Scale objects
  • ESC: Quit
  • Additional controls may be present in later versions (see code comments).

Evolution

This project demonstrates the step-by-step evolution of a 3D space simulation in Python, starting from basic graphics to a feature-rich, interactive, and audiovisual experience. Each file builds upon the previous, showcasing new programming concepts and techniques.


Created as a learning and demonstration project for 3D graphics, Pygame, and Python programming.

About

Python programs that simulate 3D space scenes using Pygame

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages