Coder Social home page Coder Social logo

pythom1234 / ursina Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pokepetter/ursina

1.0 0.0 0.0 29.07 MB

A game engine powered by python and panda3d.

Home Page: https://pokepetter.github.io/ursina/

License: MIT License

Python 99.81% HTML 0.01% Batchfile 0.18%

ursina's Introduction

ursina ʕ •ᴥ•ʔゝ□

An easy to use game engine/framework for python.

Banner

Trailer

Getting Started

  1. Install Python 3.6 or newer. https://www.python.org/downloads/
  2. Open cmd/terminal and type:
pip install ursina

If you want to install the newest version from git, you can install like this:

pip install git+https://github.com/pokepetter/ursina.git

If you want to easily edit the source, it's recommended to clone the git repo and install as develop like this. Make sure you have git installed. https://git-scm.com/

git clone https://github.com/pokepetter/ursina.git
python setup.py develop

Also install any of the optional dependencies you want from the list below, or install them all with:

pip install ursina[extras]

On some systems you might have to use pip3 instead of pip in order to use Python 3 and not the old Python 2.

Dependencies

  • python 3.6+
  • panda3d
  • pillow, for texture manipulation
  • psd-tools, for converting .psd files
  • blender, for converting .blend files
  • pyperclip, for copy/pasting

Examples

from ursina import *            # this will import everything we need from ursina with just one line.

app = Ursina()
ground = Entity(
    model = 'cube',
    color = color.magenta,
    z = -.1,
    y = -3,
    origin = (0, .5),
    scale = (50, 1, 10),
    collider = 'box',
    )

app.run()                       # opens a window and starts the game.

How do I make a game?

Ursina games are made by writing Python code. You can use any text editor you want, but personally I like to use Atom.

  1. Create an empty .py file called ursina_game.py
  2. Copy this text into your new file:
from ursina import *           # this will import everything we need from ursina with just one line.

app = Ursina()

player = Entity(
    model = 'cube' ,           # finds a 3d model by name
    color = color.orange,
    scale_y = 2
    )

def update():                  # update gets automatically called by the engine.
    player.x += held_keys['d'] * .1
    player.x -= held_keys['a'] * .1


app.run()                     # opens a window and starts the game.
  1. Type this in the terminal to start the game:

    python ursina_game.py
    

    If you use Atom, I recommend installing the package atom-python-run to run your scripts with the press of a button.

  2. You can now move the orange box around with 'a' and 'd'!

    To close the window, you can by default, press shift+q or press the red x. to disable this, write window.exit_button.enabled = False somewhere in your code.

Project Structure

## Project Structure

📁docs
    📃index.txt
    📃documentation.txt
    📃inventory_tutorial.txt
    ...
        # text files for the website. gets turned into .html files with sswg.

    📃cheat_sheet.html
        # auto generated documentation made with documentation_generator.py.

    📃tutorial_generator.py
        # turns specific .py files into .txt files, which can then be turned into .html by sswg.
        # this extracts the comments from the source files into description for that step and the code after into code blocks.
        # see platformer_tutorial.py for an example.

📁samples               # small example games.

📁ursina                # the actual ursina module.
    📁audio                 # built-in audio clips.
    📁editor                # the 3d level editor for ursina.
    📁fonts                 # built-in fonts.
    📁models                # .blend files, source files, for built-in 3d models.
        📁procedural            # classes for generating 3d models, like Cylinder, Quad and Terrain.
    📁models_compressed     # .blend files converted to .ursinamesh.
    📁prefabs               # higher level classes like Draggable, Slider, Sprite, etc.

    📃__init__.py
    📃application.py
    📃audio.py
    ...
        # ursina base modules, like code for Entity, input_handler, Text, window and so on.

ursina's People

Contributors

pokepetter avatar petteramland avatar werxzy avatar squigglecito avatar a2cy avatar snoroz avatar cclauss avatar philippeitis avatar diamondsbattle avatar bt530 avatar clayboone avatar albfan avatar carlsonmark avatar tannnxr avatar tanay-errorcode avatar brakingchanges avatar tom-fredricksondm avatar konvay avatar jakeroggenbuck avatar dandiez avatar ahmad-a0 avatar whutch avatar sorendeveloppement avatar binary-sequence avatar ryancollingwood avatar philipcander avatar makiyu-py avatar mxp2095onetechguy avatar luengor avatar andraskohlmann avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.