
今天加入程式設計teams課程

#include <stdio.h>
int main()
{
int a=100;
int b=200;
int *p;
p = &a;
printf(" %d \n", p);
p = &b;
printf(" %d \n", p);
}

PImage img1;
PImage img2;
PImage img3;
PImage img;
void setup(){
size(300,300);
img1=loadImage("img1.png");
img1=loadImage("img2.png");
img1=loadImage("img3.png");
img = img1;
}
void draw(){
image( img, 100,100);
}
void keyPressed(){
if(keyCode==RIGHT)img=img3;
if(keyCode==LEFT)img=img2;
}
void keyReleased(){
img=img1;
}

PImage img1, img2, img3;
PImage img;
float x=100, y=100, vx=0;
void setup(){
size(300,300);
img1=loadImage("img1.png");
img2=loadImage("img2.png");
img3=loadImage("img3.png");
img = img1;
}
void draw(){
background(255);
image( img, x,y);
x += vx;
}
void keyPressed(){
if(keyCode==RIGHT){
img=img3; vx = 1;
}else if(keyCode==LEFT){
img=img2; vx = -1;
}
}
void keyReleased(){
img=img1; vx = 0;
}

PImage img;
float x=100, y=100, vx=0;
void setup(){
size(300,300);
img1=loadImage("img1.png");
img2=loadImage("img2.png");
img3=loadImage("img3.png");
img = img1;
}
void draw(){
background(255);
image( img, x,y);
x += vx;
}
void keyPressed(){
if(keyCode==RIGHT){
img=img3; vx = 1;
}else if(keyCode==LEFT){
img=img2; vx = -1;
}
}
void keyReleased(){
img=img1; vx = 0;
}

PImage img;
float x=100 ,y=100 ,vx=3 ,vy=-10;
void setup(){
size(204,247);
img=loadImage("dora.png");
}
void draw(){
background(255);
image(img,x,y);
x += vx;
y += vy;
vy += 0.98;
if( y>=200 )vy = -vy*0.9;
if( x>300 ) vx = -vx;
if(x<0) vx = -vx;
}
float x=100 ,y=100 ,vx=3 ,vy=-10;
void setup(){
size(204,247);
img=loadImage("dora.png");
}
void draw(){
background(255);
image(img,x,y);
x += vx;
y += vy;
vy += 0.98;
if( y>=200 )vy = -vy*0.9;
if( x>300 ) vx = -vx;
if(x<0) vx = -vx;
}
沒有留言:
張貼留言