VortexDocs
  • Vortex Engine
    • Installation
      • 1. Install Python
      • 2. Install VortexEngine
      • 3. Install Additional Dependencies
    • Getting Started
      • 1. Initialize Vortex
      • 2. Create Game Objects
      • 3. Add Labels
      • 4. Add a First Person Controller
      • 5. Run the Game
    • API Reference
      • 1. Vortex Class
      • 2. Tool Module
      • 3. Data Module
    • Example
      • 1. Basic Example
      • 2. API Integration Example
    • Troubleshooting
      • 1. ModuleNotFoundError
        • 1. Verify Installation:
        • 2. Check Python Environment:
        • 3. Verify Import Statement:
      • 2. Color Not Recognized
        • 1. Check Color Input:
        • 2. Refer to color_dict:
        • 3. Update Color Usage:
        • 4. Verify Code:
    • Additional Resources
  • Vortex Breakout
Powered by GitBook
On this page
  1. Vortex Engine
  2. Example

1. Basic Example

This example demonstrates how to set up a basic game environment using VortexEngine.


from vortex import Vortex

# Initialize the Vortex engine
vortex = Vortex(PrivateKey="your_private_key", Address="your_address", Chain="Aptos")

# Create a cube entity
cube = vortex.Object(model='cube', color=vortex.color('blue'), scale=(2, 2, 2))

# Add a text label
label = vortex.Label(text="Welcome to Vortex!", position=(0, 2, 0))

# Add a first-person controller
fps = vortex.firstPersonController()

# Run the game
vortex.run()

In this example:

  • Initialization: A Vortex instance is created with your private key, address, and chain information.

  • Game Objects: A blue cube is created with a scale of (2, 2, 2), and a label with the text "Welcome to Vortex!" is positioned at (0, 2, 0).

  • Controller: A first-person controller is added for player navigation.

  • Execution: The run method starts the game.

PreviousExampleNext2. API Integration Example

Last updated 9 months ago