01219245/cocos2d-js/Sprites/old getting started

จาก Theory Wiki
รุ่นแก้ไขเมื่อ 16:07, 15 กุมภาพันธ์ 2559 โดย Jittat (คุย | มีส่วนร่วม) (หน้าที่ถูกสร้างด้วย 'Make sure you get the framework installed properly. Follow instructions here. In the steps that f...')
(ต่าง) ←รุ่นแก้ไขก่อนหน้า | รุ่นแก้ไขล่าสุด (ต่าง) | รุ่นแก้ไขถัดไป→ (ต่าง)
ไปยังการนำทาง ไปยังการค้นหา

Make sure you get the framework installed properly. Follow instructions here.

In the steps that follow, we will create a new Cocos2d-JS application. These are the steps that you have to do when you want to start a new project.

First, find a location in your file system to keep your work. We will name our first project as tutorial1. We will create our first project by calling

cocos new tutorial1 --no-native -l js
Notes: The options --no-native is important because it tells Cocos2d-JS not to try to compile our program for other platforms (e.g., for Android or iOS).

The script will create a directory tutorial1 for your project with a sample HelloWorld code, for which we shall delete later, but for now let's make sure it is runnable.

cd tutorial1
cocos run -p web

You will see a web page with spanning image. If this is working, hit ctrl-c in the console to stop the web server.