ursina engine

덤프버전 :


1. 개요
2. 장단점
2.1. 장점
2.2. 단점
3. 문법


1. 개요[편집]


게임 개발을 위한 파이썬 라이브러리.
일반적인 개발자들은 잘 모르지만, 인터넷에서 잘 알려진 엔진이다.
관련 서적도 거의 없으며, 2021년 3월 기준에도 위키백과에 없다.

2. 장단점[편집]



2.1. 장점[편집]


  • 초보도 쉽게 배울 수 있다.
  • 자유도가 높다.
  • 오픈소스 툴이며 무료이다.

2.2. 단점[편집]


  • 속도가 매우 느리다.
  • 공식 홈페이지 말고는 자료를 거의 찾을 수 없다.

3. 문법[편집]


from ursina import *
app = Ursina()
app.run()

이렇게 하면 매우 공허한 화면이 생긴다.
공식 문서를 확인하는 것이 좋다.
from ursina import *

# create a window
app = Ursina()

# most things in ursina are Entities. An Entity is a thing you place in the world.
# you can think of them as GameObjects in Unity or Actors in Unreal.
# the first paramenter tells us the Entity's model will be a 3d-model called 'cube'.
# ursina includes some basic models like 'cube', 'sphere' and 'quad'.

# the next parameter tells us the model's color should be orange.

# 'scale_y=2' tells us how big the entity should be in the vertical axis, how tall it should be.
# in ursina, positive x is right, positive y is up, and positive z is forward.

player = Entity(model='cube', color=color.orange, scale_y=2)

# create a function called 'update'.
# this will automatically get called by the engine every frame.

def update():
    player.x += held_keys['d'] * time.dt
    player.x -= held_keys['a'] * time.dt

# this part will make the player move left or right based on our input.
# to check which keys are held down, we can check the held_keys dictionary.
# 0 means not pressed and 1 means pressed.
# time.dt is simply the time since the last frame. by multiplying with this, the
# player will move at the same speed regardless of how fast the game runs.


def input(key):
    if key == 'space':
        player.y += 1
        invoke(setattr, player, 'y', player.y-1, delay=.25)


# start running the game
app.run()


[1]
이렇게 하면 매우 간단한 게임이 만들어진 것을 볼 수 있다.어?
해당 링크에서 많은 샘플을 볼수 있다.
파일:크리에이티브 커먼즈 라이선스__CC.png 이 문서의 내용 중 전체 또는 일부는 2023-11-06 14:54:52에 나무위키 ursina engine 문서에서 가져왔습니다.

[1] 사실 def input(key)로 정의하는 것보다 한줄로 wasd를 정의할 수 있다. 공식 문서 참조.