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.

Last updated