캐릭터+공움직이기+캐릭터움직이기 |
|||||
---|---|---|---|---|---|
작성자 | 이준호 | 등록일 | 17.07.14 | 조회수 | 64 |
1).캐릭터 void setup() { size(1080,720); smooth(); frameRate(30); } void draw() { background(255); ellipseMode(CENTER); rectMode(CENTER); fill(1); ellipse(170,170,80,80); // fill(255,174,201); ellipse(180,180,80,80); // fill(1); ellipse(320,170,80,80); // fill(255,174,201); ellipse(314,180,80,80); // fill(1); ellipse(250,250,250,250); // fill(163,73,164); ellipse(190,240,30,100); // fill(163,73,164); ellipse(310,240,30,100); } ----------------- 2).공움직이기 int x=250; int y=250; int speed=3; void setup() { size(500,500); } void draw() { background(1); ellipseMode(CENTER); ellipse(x,y,60,60); if(x>500 || x<0) speed=-speed; x=x+speed; } ----------------- 3.캐릭터움직이기 void setup() { size(1080,720); smooth(); frameRate(30); } void draw() { background(255); ellipseMode(CENTER); rectMode(CENTER); fill(1); ellipse(mouseX+170,mouseY+170,80,80); ellipse(mouseX-170,mouseY+170,80,80); // fill(255,174,201); ellipse(mouseX+180,mouseY+180,80,80); ellipse(mouseX-180,mouseY+180,80,80); // fill(1); ellipse(mouseX+320,mouseY+170,80,80); ellipse(mouseX-320,mouseY+170,80,80); // fill(255,174,201); ellipse(mouseX+314,mouseY+180,80,80); ellipse(mouseX-314,mouseY+180,80,80); // fill(1); ellipse(mouseX+250,mouseY+250,250,250); ellipse(mouseX-250,mouseY+250,250,250); // fill(163,73,164); ellipse(mouseX+190,mouseY+240,30,100); ellipse(mouseX-190,mouseY+240,30,100); // fill(163,73,164); ellipse(mouseX+310,mouseY+240,30,100); ellipse(mouseX+310,mouseY+240,30,100); } |
이전글 | 캐릭터 |
---|---|
다음글 | 쿠마몬 |