[[Programing]] > [[p5.js]] > p5.play.js

#title("Ϥ褦p5.play.js")

p5.play.jsϡp5.jsѤΥ饤֥ǡץ饤ȤȽʤɤ򥵥ݡȤƤޤ

ѥեޥ󥹤ꥷץ뤵ͥ褷ƺƤꡢ3Dʪ󥸥ϥݡȤƤޤ

#contents

*  [#g9f5dd1a]

-[[p5.play - a game library for p5.js:http://p5play.molleindustria.org/]]
-[[Example:http://p5play.molleindustria.org/examples/index.html]]
-[[ե:http://p5play.molleindustria.org/docs/index.html]]


* Ϥ [#gfbe93cb]

+ ƥȥǥѰդ
+ p5.js[[:http://p5js.org/download/]]
+ p5.play.js[[:http://p5play.molleindustria.org/]]
+ p5.jsp5.play.jsϡlibեƤ
+ HTMLեѰդ
 <!DOCTYPE html>
 <html>
   <head>
     <title>p5.play Example</title>
     <script src="lib/p5.js" type="text/javascript"></script>
     <script src="lib/p5.play.js" type="text/javascript"></script>  
     <script src="sketch.js" type="text/javascript"></script>
   </head>
   <body>
   </body>
 </html>
+ sketch.jsäơʥɤ򵭽Ҥ롣ϡHTMLեƱե֤
 function setup() {
  createCanvas(800,400);
  createSprite(400, 200, 50, 50);
 }
 
 function draw() {
  background(255,255,255);  
  drawSprites();
 }
+ HTMLե򳫤

* ץ [#r0294f9d]

ĤäƤߤsketch.jsˡ򵭽Ҥ롣

** ޥ [#dc5b7510]

ޥΰ֤ˡץ饤ȤǻͳѤ

 var ball;
 var img;
 
 setup = function() {
 	createCanvas(800,400);
 	background(200);
 	ball = createSprite(400, 200, 50, 50);
 	img = createSprite(400, 200, 50, 50);
 }
 
 draw = function() {
 	ball.position.x = mouseX;
 	ball.position.y = mouseY;
 	img.position.x = mouseX;
 	img.position.y = mouseY;
 	drawSprites();
 }

** 󥹥󥹥⡼ɤΥץ [#g5653ab8]

P5.PLAY.JS󥹥󥹥⡼ɤư褦ˤʤäƤ

 // instance mode example
 var s = function(p) {
 
 	var img;
 	p.setup = function() {
 		p.createCanvas(800,400);
 		p.background(200);
 		img = p.createSprite(400, 200, 50, 50);
 	}
 
 	p.draw = function() {
 		img.position.x = p.mouseX;
 		img.position.y = p.mouseY;
 		p.drawSprites();
 	}
 }
 
 var myp5 = new p5(s);


* ͤˤʤ [#m62add73]

-[[Space invaders game made with p5.js and the p5.play library - YouTube:https://www.youtube.com/watch?v=XHAsp17oyP0]] ١Ȥꥢƥ
-[[p5.jsǺ륲೫ȯĶ硪100԰ǡ֥֥åפĩ路Ƥߤ롪 : ֤Ϥä:http://webhacck.net/archives/896790.html]]

* Ϣڡ [#g3b86914]

-[[p5.js]] ñ
-[[p5.turtle.js:http://ycatch.github.io/p5.turtle.js/index.ja.html]] p5.jsΤΥȥ륰եåץäƤߤ

ȥå   ʬ Хåå   ñ측 ǽ   إ   ǽRSS