Code Monkey home page Code Monkey logo

ippclub / dora-ssr Goto Github PK

View Code? Open in Web Editor NEW
213.0 13.0 31.0 148.64 MB

Dora Project, Special Super Rare Edition.

Home Page: https://dora-ssr.net/

License: Other

CMake 0.55% Java 2.67% C++ 27.28% C 10.07% Objective-C++ 0.07% Lua 20.39% Shell 0.01% Batchfile 0.01% SuperCollider 0.03% Scala 0.04% Makefile 0.01% Rust 8.02% JavaScript 11.02% HTML 0.43% CSS 1.62% TypeScript 4.26% MDX 13.51% Python 0.04%
2d-game-engine yuescript teal-lang lua rust game-development cpp20 typescript

dora-ssr's Introduction

Dora SSR

Dora SSR (多萝珍奇引擎)

English | 中文

Static Badge Static Badge Static Badge Static Badge Static Badge Static Badge Static Badge Static Badge Android Linux Windows macOS iOS

Dora SSR is a game engine for rapid development of 2D games on various devices. It has a built-in easy-to-use development tool chain that supports direct game development on mobile phones, open source handhelds and other devices.

Playground

Dora SSR Joins the Open Atom Foundation

We are delighted to announce that the Dora SSR project has officially become a donation and incubation preparatory project under the Open Atom Foundation. This new stage of development signifies our steadfast commitment to building a more open and collaborative gaming development environment.

About the Open Atom Foundation

The Open Atom Foundation is a non-profit organization dedicated to supporting and promoting the development of open-source technologies. Within this foundation's community, Dora SSR will utilize broader resources and community support to propel the project's development and innovation. For more information, please visit the foundation's official website.

Key Features

  • Manages game scenes based on tree node structure.

  • Basic 2D platform game functions, including game logic and AI development framework.

  • Easy-to-use ECS module for game entity management.

  • Asynchronous processing of file read and write, resource loading and other operations.

  • Upgraded Lua binding with support for inheriting and extending low-level C++ objects.

  • Supports Yuescript language, strong expressive and concise Lua dialect.

  • Supports for the Teal language, a statically typed dialect for Lua.

  • Supports TypeScript, a statically typed superset of JavaScript that adds powerful type checking.

  • Supports TSX, allows embedding XML/HTML-like text within scripts, used with TypeScript.

  • Supports the Rust language, running on the built-in WASM runtime with Rust bindings.

  • 2D skeletal animation and physics engine support.

  • Built-in out-of-the-box Web IDE, providing file management, code inspection, completion, highlighting and definition jump.

  • Supports asynchronous operation of SQLite for real-time query and managing large game configuration data.

  • Supports reading Excel spreadsheet data and synchronizing it to SQLite tables.

  • Supports the Yarn Spinner language, making it easy to write complex game story systems.

  • Built-in machine learning algorithm framework for innovative gameplay.

  • Provides vector graphics rendering API, which can directly render SVG format files without CSS.

  • Built-in ImGui, easy to create debugging tools and UI interface.

  • Supports FLAC, OGG, MP3 and WAV multi-format audio playback.

  • Supports True Type font rendering and basic typesetting.

  • Provides open art resources and game IPs that can be used to create your own games - "Luv Sense Digital".

  LSD


Installation

  • Quick start

    • Android

        1. Download and install the APK package on the running terminal for games.
        1. Run the software, and access the server address displayed by the software through the browser of a PC (tablet or other development device) on the LAN.
        1. Start game development.
    • Windows, macOS

        1. Download and run the software.
          • Get software on macOS with Homebrew using
          brew tap ippclub/dora-ssr
          brew install --cask dora-ssr
        1. Run the software and access the server address displayed by the software through a browser.
        1. Start game development.
    • Linux

        1. Installation.
        • Ubuntu Jammy

          sudo add-apt-repository ppa:ippclub/dora-ssr
          sudo apt update
          sudo apt install dora-ssr
        • Debian Bookworm

          sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 9C7705BF
          sudo add-apt-repository -S "deb https://ppa.launchpadcontent.net/ippclub/dora-ssr/ubuntu jammy main"
          sudo apt update
          sudo apt install dora-ssr
        1. Run the software and access the server address displayed by the software through a browser.
        1. Start game development.
  • Engine project development

    For the installation and configuration of Dora SSR project development, see Official Documents for details.


Quick Start

  1. Step 1: Create a new project

    • In the browser, open the right-click menu of the game resource tree on the left side of the Dora Dora editor.

    • Click on the menu item New and choose to create a new folder.

  2. Step 2: Write game code

    • Create a new game entry code file of Lua (Yuescript, Teal, Typescript or TSX) under the project folder, named init.

    • Write Hello World code:

  • Lua
local _ENV = Dora()

local sprite = Sprite("Image/logo.png")
sprite:schedule(once(function()
  for i = 3, 1, -1 do
    print(i)
    sleep(1)
  end
  print("Hello World")
  sprite:perform(Sequence(
    Scale(0.1, 1, 0.5),
    Scale(0.5, 0.5, 1, Ease.OutBack)
  ))
end))
  • Teal
local sleep <const> = require("sleep")
local Ease <const> = require("Ease")
local Scale <const> = require("Scale")
local Sequence <const> = require("Sequence")
local once <const> = require("once")
local Sprite <const> = require("Sprite")

local sprite = Sprite("Image/logo.png")
if not sprite is nil then
  sprite:schedule(once(function()
    for i = 3, 1, -1 do
      print(i)
      sleep(1)
    end
    print("Hello World")
    sprite:perform(Sequence(
      Scale(0.1, 1, 0.5),
      Scale(0.5, 0.5, 1, Ease.OutBack)
    ))
  end))
end
  • Yuescript
_ENV = Dora!

with Sprite "Image/logo.png"
   \schedule once ->
     for i = 3, 1, -1
       print i
       sleep 1
     print "Hello World!"
     \perform Sequence(
       Scale 0.1, 1, 0.5
       Scale 0.5, 0.5, 1, Ease. OutBack
     )
  • Typescript
import {Sprite, Ease, Scale, Sequence, once, sleep} from 'dora';

const sprite = Sprite("Image/logo.png");
if (sprite) {
  sprite.schedule(once(() => {
    for (let i of $range(3, 1, -1)) {
      print(i);
      sleep(1);
    }
    print("Hello World");
    sprite.perform(Sequence(
      Scale(0.1, 1, 0.5),
      Scale(0.5, 0.5, 1, Ease.OutBack)
    ))
  }));
}
  • TSX
import { React, toNode, useRef } from 'dora-x';
import { ActionDef, Ease, Sprite, once, sleep } from 'dora';

const actionRef = useRef<ActionDef.Type>();
const spriteRef = useRef<Sprite.Type>();

const onUpdate = once(() => {
  for (let i of $range(3, 1, -1)) {
    print(i);
    sleep(1);
  }
  print("Hello World");
  if (actionRef.current && spriteRef.current) {
    spriteRef.current.perform(actionRef.current);
  }
});

toNode(
  <sprite
    ref={spriteRef}
    file='Image/logo.png'
    onUpdate={onUpdate}
  >
    <action ref={actionRef}>
      <sequence>
        <scale time={0.1} start={1} stop={0.5}/>
        <scale time={0.5} start={0.5} stop={1} easing={Ease.OutBack}/>
      </sequence>
    </action>
  </sprite>
);
  • Or you can write code in Rust, build it into WASM file named init.wasm, upload it to engine to run.
use dora_ssr::*;

fn main () {
  let mut sprite = match Sprite::with_file("Image/logo.png") {
    Some(sprite) => sprite,
    None => return,
  };
  let mut sprite_clone = sprite.clone();
  sprite.schedule(once(move |mut co| async move {
    for i in (1..=3).rev() {
      p!("{}", i);
      sleep!(co, 1.0);
    }
    p!("Hello World");
    sprite_clone.perform_def(ActionDef::sequence(&vec![
      ActionDef::scale(0.1, 1.0, 0.5, EaseType::Linear),
      ActionDef::scale(0.5, 0.5, 1.0, EaseType::OutBack),
    ]));
  }));
}
  1. Step 3: Run the game

    Click the 🎮 icon in the lower right corner of the editor, then click the menu item Run. Or press the key combination Ctrl + r.

  2. Step 4: Publish the game

    • Open the right-click menu of the project folder just created through the game resource tree on the left side of the editor and click the Download option.

    • Wait for the browser to pop up a download prompt for the packaged project file.

For more detailed tutorials, please check official documents.


Example Projects

Loli War


Zombie Escape


Dismentalism


Luv Sense Digital


Documentation


Community


Contribute

Welcome to participate in the development and maintenance of Dora SSR. Please see Contributing Guidelines to learn how to submit Issues and Pull Requests.


License

Dora SSR uses the MIT License. The project was originally named Dorothy SSR and is currently undergoing a renaming process.

dora-ssr's People

Contributors

dependabot[bot] avatar neverchanje avatar pigpigyyy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dora-ssr's Issues

OwnVector使用方法请教

作者你好
在学习你的代码过程中,有个代码问题有点疑问,OwnVector这个模板类的remove方法的不太清楚要怎么调用.

/** @brief vector of pointers, but accessed as values
 pointers pushed into OwnVector are owned by the vector,
 pointers will be auto deleted when it`s erased/removed from the vector
 or the vector is destroyed.
 Used with Composition Relationship.
*/
template<class T>
class OwnVector : public vector<Own<T>>
{
	typedef vector<Own<T>> OwnV;
public:
	using OwnV::OwnV;
	using OwnV::insert;

	bool remove(T* item)
	{
		auto it = std::remove(OwnV::begin(), OwnV::end(), item);
		if (it == OwnV::end()) return false;
		OwnV::erase(it);
		return true;
	}
	typename OwnV::iterator index(T* item)
	{
		return std::find(OwnV::begin(), OwnV::end(), item);
	}
	bool fast_remove(T* item)
	{
		size_t index = std::distance(OwnV::begin(), OwnVector::index(item));
		if (index < OwnV::size())
		{
			OwnV::at(index) = OwnV::back();
			OwnV::pop_back();
			return true;
		}
		return false;
	}
};

例子:

class demo{
public:
   demo(int i):num(i){
      cout<<"construct! " << i <<endl;
   }

   ~demo(){
      cout<<"class destruct! " << num <<endl;
   }
private:
   int num;
};


int main() {
    OwnVector<demo> ov;
    ov.push_back(New<demo>(1));
    ov.push_back(New<demo>(2));
    //ov.erase(ov.begin());
    //ov.remove();
    return 0;
}

比如这个例子中我想remove掉第一个item,应该怎么写呢?我在这个项目好像没有用到这个remove方法

CMake Support

Very nice project.

1 - Can you add support for CMake?
2- There is any real game with it? Do you have more samples?

Thanks.

Tracking: support typescript as the scripting language

The background shared by @pigpigyyy:

Teal was introduced a long while ago in this project when Typescript was not yet mature. However, when it comes to a statically typed scripting language, Typescript has grown to be the most popular option today. We can explore the possiblity of transpiling TS to Lua https://github.com/TypeScriptToLua/TypeScriptToLua and provide the type definitions for Dorothy like https://github.com/hazzard993/love-typescript-definitions

Eventually, we may also need to provide a template project for scaffolding.
https://github.com/hazzard993/love-typescript-template

discussion: the minimal C++ compiler support

As of today, I believe there is no reason to use compiler <= C++17. We can use C++20 features if necessary.

Once we determined the minimum required C++ version, we need to document it in somewhere, e.g, #26.

第三方库 源码

像libbx.a libsoloud.a很多第三方库 请问一下 这些源码在哪里可以下载 自己编译

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.