[[분류:게임 개발 도구]] [목차] == 개요 == 게임 개발을 위한 [[파이썬]] 라이브러리. 일반적인 개발자들은 잘 모르지만, [[인터넷]]에서 잘 알려진 엔진이다. 관련 서적도 거의 없으며, 2021년 3월 기준에도 [[위키백과]]에 없다. == 장단점 == === 장점 === * 초보도 쉽게 배울 수 있다. * 자유도가 높다. * 오픈소스 툴이며 무료이다. === 단점 === * 속도가 매우 느리다. * 공식 홈페이지 말고는 자료를 거의 찾을 수 없다. == 문법 == {{{#!syntax python from ursina import * app = Ursina() app.run() }}} 이렇게 하면 매우 공허한 화면이 생긴다. [[https://www.ursinaengine.org/documentation.html|공식 문서]]를 확인하는 것이 좋다. {{{#!syntax python 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() }}} [* 사실 def input(key)로 정의하는 것보다 한줄로 wasd를 정의할 수 있다. 공식 문서 참조.] 이렇게 하면 매우 간단한 게임이 만들어진 것을 볼 수 있다.--[[마인크래프트|어?]]-- [[https://github.com/pokepetter/ursina/tree/master/samples|해당 링크]]에서 많은 샘플을 볼수 있다.