2016-07-18 3 views
0

Playground.js website에서 처음 두 개의 자습서를 살펴 보았지만 사각형이 사각형을 렌더링하지 않습니다.Playground.js 렌더링되지 않음

index.html 
scripts 
---main.js 
---playground.js

index.html을 :

<!DOCTYPE html> 
<html> 
    <head><title>Simple Game</title></head> 

    <body> 

     <script src="scripts/main.js"></script> 
     <script src="scripts/playground.js"></script> 
    </body> 
</html> 

main.js :

var app = playground({ 
    render: function() { 
     this.layer.clear("#000088"); 
     this.layer.fillStyle("#ffffff"); 
     this.layer.fillRect(32, 32, 64, 64); 
    } 
}); 

playground.js 웹 사이트에서 다운로드 한 파일은 다음 디렉토리 구조입니다.

어떤 문제가 있으며 어떻게 해결할 수 있습니까?

+2

기본 및 놀이터 스크립트 태그를 전환하십시오. 주문 내용은 – Ultimater

+0

일했습니다! 이 질문을 답변으로 추가 할 수 있습니까? – CDuck

답변

1

기본 및 놀이터 스크립트 태그를 전환하십시오. 주문 내용 :

<script src="scripts/playground.js"></script> 
    <script src="scripts/main.js"></script>