LoginSignup
3
5

More than 5 years have passed since last update.

Defoldの使い方(インストール&チュートリアル)

Last updated at Posted at 2016-03-27

まえがき。

インストールとチュートリアルの途中までの解説。
※随時アップデートします。なんか文句あれば書けば直すよ。

インストール

ココに行く。

これをクリック。

画面が小さいScreen Shot 2016-03-18 at 4.46.50 PM.png

下のGoogleアカウントでログイン。

右上から下から選ぶ。

Screen Shot 2016-03-18 at 4.52.27 PM.png

まずここで、画面の見方見るのがいい。

プラットフォームゲームの作り方の公式チュートリアル

プラットフォームってマリオ的だが、ウィンドランナー的なやつ。

知っておく概念

Emptyという名前でプロジェクトを作った場合こうなってた。

ちなみにプロジェクトのトップはこんな感じにDefoldの配置先の配下に追加されていくよだ。

/Applications/Defold-macosx.cocoa.x86_64/branches/11408/7609/Empty

collectionという単位にいろんなcollectionをペタペタ載せる感じ?

go(GameObject)を載せる

ショートカットは「I」
Screen Shot 2016-03-25 at 8.34.30 AM.png

Spriteの追加

"Add Component"という項目がある。

命名の仕方

idが相当
Screen Shot 2016-03-21 at 4.16.29 PM.png

注意すること

Atlasはすぐ保存

Default Animationの項目に何も出ないとハマる。

command + Sですぐ保存しないとダメ。

"Add Component From File"という項目もあることに注意する。

ショートカットはShift+I

"Add Collection From File"もある。

ショートカットはShift+O

ドキュメントは特にカッコ書きをしてないので、"Add Component"をしてからファイルから選択するのかと勘違いしそう。

platform.scriptを忘れず

platform.scriptを作ったあとにplatform.goに載せる説明がない。

Colliderをつけること

説明もなくカエルの「hero」にColliderをつけている

platform.goやplatform_long.goにBox Shapeをつけている。

コピペの注意

ground.script
function on_message(self, message_id, message, sender)
    if message_id == hash("set_speed") then 1
        self.speed = message.speed 2
    end
end

メモ

Screen Shot 2016-03-21 at 4.16.55 PM.png

GameObjectの追加も「I」
Screen Shot 2016-03-21 at 4.16.22 PM.png

「STEP 5 - Refactoring the level」が意味がわからない

Now, create a new folder alongside "main" and move all level assets to it.

おそらく、今までmainフォルダ内に作ってたものを"main"フォルダと同じく"level"フォルダを作成し、level系のアセットを持って行けと言っている?
Screen Shot 2016-03-27 at 4.35.07 PM.png

おそらく"main.collection"以外全部かも?
後々のスクリーンショットではimagesやground.scriptも「level」フォルダに移動している。

STEP 5のこのスクショで暗黙の了解でいつのまにオブジェクト置いてる

script_property.png

heroはx:100 y:100くらいがいい。

Open "main.collection" and replace "ground.collection" with "level.collection".

これは、"main.collection"でしれっと置いてた"ground.collection"のこと。

"level.collection"に置き換えろと。
Screen Shot 2016-03-27 at 6.54.08 PM.png

やり方:ground.collectionを右クリックでDeleteして、Shift+Oを押下する。

10の説明

Copy "platform.go" to a new file (right-click the file in the Project Explorer and select Copy, then right-click again and select Paste) and call the new file "platform_long.go".

一旦作った"platform.go"をコピペで"platform_long.go"と名付ける。

factoryのプロパティは必須

platform_factoryにはplatform.go
platform_long_factoryにはplatform_long.goを設定。
書いてなくてビルド不可。
Screen Shot 2016-03-27 at 6.28.17 PM.png

play_animation()メソッドについて

Open the "hero.script" file and add the following functions:

とあるが、一番下に追加してはならない。
update()メソッドの上に書かないと定義したとみなしてくれない。

update_animation()メソッドについて

update()の中に書きます。
しかも忘れるとアニメーションが切り替わらないので忘れないようにしましょう。
play_animationの下で、updateメソッドの上になります。

いつの間にか生成されているフォルダ

最後の章「STEP 9 - COINS TO COLLECT」にて、いつの間にかlevelフォルダの中にobjectsフォルダが入っている。
その中にcoing.go等色々入ってるのでスクリーンショットで確認すること。

ショートカット

Project ▸ Build and Launch

command + B

3
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
5