Dora Start!
1. Installation
- Android
-
- Download and install the APK package on the game's running terminal.
-
- Run the software and access the server address displayed by the software through the browser of the PC (tablet or other development device) in the LAN.
-
- Start game development.
-
- Windows, macOS
-
- Download and run the software.
- Get software on macOS with Homebrew using
brew tap ippclub/dora-ssr
brew install --cask dora-ssr
- Get software on macOS with Homebrew using
- Download and run the software.
-
- Access the server address displayed by the software through a browser.
-
- Start game development.
-
- Linux
-
- 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
-
- Run the software and access the server address displayed by the software through a browser.
-
- Start game development.
-
2. Write the Game
- Step One: 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 the
New
menu item, select "New Folder", and name itHello
.
- Step Two: Write the game code
- Create a new game entry code file in the project folder, select the Yuescript language (or Teal, Lua, Typescript), and name it
init
. - Write the code:
- Create a new game entry code file in the project folder, select the Yuescript language (or Teal, Lua, Typescript), and name it
- TSX
- Yuescript
- Lua
- Teal
- Typescript
Hello/init.tsx
// @preview-file on
import { React, toNode, useRef } from 'dora-x';
import { Ease, Move, Sprite } from 'dora';
const spriteRef = useRef<Sprite.Type>();
// create the root node of the game scene tree
// and a sprite as a child node
toNode(
<node onTapBegan={(touch) => {
const {current: sprite} = spriteRef;
if (sprite) {
sprite.perform(Move(
1, // duration in seconds
sprite.position, // start position
touch.location, // end position
Ease.OutBack // easing function
));
}
}}>
<sprite ref={spriteRef} file='Image/logo.png'/>
</node>
);
Hello/init.yue
-- import modules
_ENV = Dora!
-- create a sprite
sprite = Sprite "Image/logo.png"
-- create the root node of the game scene tree
with Node!
-- mount the sprite to the root node
\addChild sprite
-- receive and process click events to move the sprite
.touchEnabled = true
\slot "TapBegan", (touch)->
sprite\perform Move(
1 -- duration in seconds
sprite.position -- start position
touch.location -- end position
Ease.OutBack -- easing function
)
Hello/init.lua
-- import modules
local Sprite <const> = require("Sprite")
local Node <const> = require("Node")
local Move <const> = require("Move")
local Ease <const> = require("Ease")
-- create a sprite
local sprite = Sprite("Image/logo.png")
-- create the root node of the game scene tree
local root = Node!
-- mount the sprite to the root node
root:addChild(sprite)
-- receive and process click events to move the sprite
root.touchEnabled = true
root:slot("TapBegan", function(touch)
sprite:perform(Move(
1, -- duration in seconds
sprite.position, -- start position
touch.location, -- end position
Ease.OutBack -- easing function
))
end)
Hello/init.tl
-- import modules
local Sprite <const> = require("Sprite")
local Node <const> = require("Node")
local Move <const> = require("Move")
local Ease <const> = require("Ease")
local type Touch = require("TouchType")
-- create a sprite
local sprite = Sprite("Image/logo.png")
-- create the root node of the game scene tree
local root = Node!
-- mount the sprite to the root node
root:addChild(sprite)
-- receive and process click events to move the sprite
root.touchEnabled = true
root:slot("TapBegan", function(touch: Touch)
sprite:perform(Move(
1, -- duration in seconds
sprite.position, -- start position
touch.location, -- end position
Ease.OutBack -- easing function
))
end)
Hello/init.ts
// import modules
import { Ease, Move, Node, Slot, Sprite } from 'dora';
// create a sprite
const sprite = Sprite("Image/logo.png");
// create the root node of the game scene tree
const root = Node();
// mount the sprite to the root node
root.addChild(sprite);
// receive and process click events to move the sprite
root.touchEnabled = true;
root.slot(Slot.TapBegan, touch => {
sprite.perform(
Move(
1, // duration in seconds
sprite.position, // start position
touch.location, // end position
Ease.OutBack // easing function
)
);
});
- Step Three: Run the game
Click the 🎮
icon in the lower right corner of the editor, then click the Run
menu item. Alternatively, press the Ctrl + r
key combination.
3. Publish the Game
- Open the right-click menu of the newly created project folder in the game resource tree on the left side of the editor.
- Click the
Download
option and wait for the browser to prompt for downloading the packaged project file.