Skip to content

Instantly share code, notes, and snippets.

@alexanderankin
Created September 16, 2023 23:04
Show Gist options
  • Select an option

  • Save alexanderankin/6dcea6e3ddbee6221f0329c5ea154814 to your computer and use it in GitHub Desktop.

Select an option

Save alexanderankin/6dcea6e3ddbee6221f0329c5ea154814 to your computer and use it in GitHub Desktop.
ursina examples
from ursina import *
window.borderless = False
window.title = "hello-world"
app = Ursina()
player = Entity(model="cube",
color=color.blue,
texture="white_cube",
scale_y=2)
def update():
# player.rotation_x = player.rotation_x + 0.25
# player.rotation_y = player.rotation_y + 0.5
if player.x < 6.5: player.x += held_keys["d"] * 0.1
if player.x > -6.5: player.x -= held_keys["a"] * 0.1
if player.y < 3: player.y += held_keys["w"] * 0.1
if player.y > -3: player.y -= held_keys["s"] * 0.1
player.rotation_x += held_keys["up arrow"] * 2
player.rotation_x -= held_keys["down arrow"] * 2
player.rotation_y += held_keys["right arrow"] * -2
player.rotation_y -= held_keys["left arrow"] * -2
app.run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment