🍟🍟Week12🍟🍟
[11/29 (一)]
今日工作🈶🈶🈶:
1. Blog開起來,要寫期末規劃 Game (2D,3D,互動的),工具
Processing做出來(可以兩人1組)
ex. 打桌球、俄羅斯方塊、Flappy Bird、一二三木頭人、Doodle Jump、Geomotry Dash、打蟑 螂.....其他請看Teams老師上課錄影!!
*示意圖(畫面*n)
*Youtube影片(遊戲流程)
*手繪(了解原理)
2. Moodle期中問卷(全系每門課都要填)
3. 老師要示範
(1) Gather Town的小人走動
(2) 互動的鋼琴
🍟開始上課
複製貼上老師的網址 https://openprocessing.org/sketch/911326,開啟Tutorial !!
可以播放和看程式碼
程式碼:
PImage img;
void setup(){
size(500,500);
img=loadImage("img.jpg");
imageMode(CENTER);
}
int a=0, b=0, x=250, y=250;
void draw(){
background(255);
//image( img, 0,0);
image( img.get(141*a, 211*b, 141,211), x,y);
if(frameCount%30==0) a = (a+1)%4;
}
void keyPressed(){
if(keyCode==RIGHT){ b=3; x++; }
if(keyCode==LEFT) { b=2; x--; }
if(keyCode==UP) { b=1; y--; }
if(keyCode==DOWN){ b=0; y++; }
}
🍟期末作品準備-Doodle Jump(塗鴉跳躍):
老師示範期末作品(Geomotry Dash)程式碼: (還沒打完,回家看Teams補)
float []badX, boubleX, boubleY; //bad是陷阱座標
void setup()
{
badX = new float[100];
badX[0]=500+random(200,300);
for(int i=0; i<100; i++)
{
badX[i]=badX[i-1]+random(200,250);
}
boubleX=new float[10];
boubleY=new float[10];
for(int i=0; i<10; i++)
{
}
}
float userY=300, bgX=0;//使用者,背景改變
void draw()
{
background(#FF0A7D);
for(int i=0; i<100; i++)
{
triangle(badX[i], 300, badX[i]-25,350, badX[i]+25,350, bad>)
}
fill(#AD0051) rect(0, 350, 600,400);
rect(150, userY, 50, 50);
if(jumping)
{
userY+=vy;
vy += 0.98/;//gravity
if(userY>300)
{
jumping=false;
userY=300;
}
}
for(int i=??; i<??; i++)
{
bubbleX[i]=bubbleX[i-1];
bubbleY[i]=bubbleY[i-1];
}
bubbleX[0]=bgx;
bubbleY[0]=userX;
bgX+=3;
}
boolean jumping=false;
void keyPressed()
{
}
沒有留言:
張貼留言