Loading...
Processing Forum
Recent Topics
All Forums
Screen name:
asm0de0
asm0de0's Profile
1
Posts
1
Responses
0
Followers
Activity Trend
Last 30 days
Last 30 days
Date Interval
From Date :
To Date :
Go
Loading Chart...
Posts
Responses
PM
Show:
All
Discussions
Questions
Expanded view
List view
Private Message
Is this the best way to write my code?
[3 Replies]
25-Feb-2012 09:43 AM
Forum:
Programming Questions
Hi everyone, i'm kinda new to Processing so please be gentle.
I need to know if this is the best way to write the code of my application and what can i do to make it shorter :
import ddf.minim.*;
Minim minim;
AudioPlayer player;
AudioSample kick;
PImage a;
PImage b;
PImage c;
PImage d;
PImage e;
PImage f;
PImage g;
PImage h;
PImage i;
PImage l;
PImage m;
PImage n;
PImage o;
PImage p;
PImage q;
PImage r;
PImage s;
PImage t;
PImage u;
PImage v;
PImage z;
PImage a1;
PImage a2;
PImage a3;
PImage a4;
PImage a5;
PImage a6;
PImage a7;
PImage a8;
PImage a9;
PImage a10;
PImage a11;
PImage a12;
PImage a13;
PImage a14;
PImage a15;
PImage a16;
PImage a17;
PImage a18;
int randomx;
int randomy;
void setup()
{
size(351, 529, P2D);
minim = new Minim(this);
player = minim.loadFile("Pokémon Red_ Green and Blue OST - Cinnabar Island's Theme.mp3", 2048);
player.play();
kick = minim.loadSample("Cry.wav", 2048);
frameRate(6);
a = loadImage ("gameboy_color_by_pilotinspektor-d4koh34.png");
b = loadImage("৳৳PO½Ké.png");
c = loadImage("&▒FDÓ8▒.png");
d = loadImage("8.png");
e = loadImage("150px-P_sprite.png");
f = loadImage("55px-Pokemon_Red_GPC_4B_8_4_8.png");
g = loadImage("Glitch_Pokémon_Template_001.png");
h = loadImage("Glitch_Pokémon_Template_002.png");
i = loadImage("RB_Glitch_E2_Sprite.png");
l = loadImage("AGsprite.png");
m = loadImage("LM4image.png");
n = loadImage("H_POKé.png");
o = loadImage("Gmp1.png");
p = loadImage("lol.png");
q = loadImage("Gsprite.png");
r = loadImage("1306695-missingno_super.png");
s = loadImage("fight.png");
t = loadImage("poke.png");
u = loadImage("PkMn_n.png");
v = loadImage("A_lowercase_color.png");
z = loadImage("RBGlitch250s.png");
a1 = loadImage("Wgdsprite.png");
a2 = loadImage("GlitchEC-Sprite.png");
a3 = loadImage("OPkMn4X.png");
a4 = loadImage("Spr_1b_142_f.png");
a5 = loadImage("YGlitch176.png");
a6 = loadImage("Spr_1b_141_f.png");
a7 = loadImage("P_Tsprite.png");
a8 = loadImage("Missingno_Y.png");
a9 = loadImage("Mp'u.png");
a10 = loadImage("10-capture_02052010_093910.png");
a11 = loadImage("PokedollarGlitch.png");
a12 = loadImage("Ulsprite.png");
a13 = loadImage("Ghost_I.png");
a14 = loadImage("15px-94.png");
a15 = loadImage("GlitchE0.png");
a16 = loadImage("RBGlitch234.png");
a17 = loadImage("m.png");
a18 = loadImage("Missingno_RB.png");
}
void draw()
{
image(a,0,0);
//image(b,random(276),random(221));
//image(c,random(276),random(221));
//image(d,random(276),random(221));
//image(e,random(276),random(221));
//image(f,random(276),random(221));
//image(g,random(276),random(221));
//image(h,random(276),random(221));
//image(i,random(276),random(221));
//image(l,random(276),random(221));
//image(m,random(276),random(221));
//image(n,random(276),random(221));
//image(o,random(276),random(221));
//image(p,random(276),random(221));
//image(q,random(276),random(221));
//image(r,random(276),random(221));
//image(s,random(276),random(221));
//image(t,random(276),random(221));
//image(u,random(276),random(221));
//image(v,random(276),random(221));
//image(z,random(276),random(221));
//image(a1,random(276),random(221));
image(a2,random(276),random(221));
image(a3,random(276),random(221));
image(a4,random(276),random(221));
image(a5,random(276),random(221));
image(a6,random(276),random(221));
image(a7,random(276),random(221));
image(a8,random(276),random(221));
image(a9,random(276),random(221));
image(a10,random(276),random(221));
image(a11,random(276),random(221));
image(a12,random(276),random(221));
image(a13,random(276),random(221));
image(a14,random(276),random(221));
image(a15,random(276),random(221));
image(a16,random(276),random(221));
image(a17,random(276),random(221));
image(a18,random(276),random(221));
}
void keyPressed()
{
if ( key == 'a' ) kick.trigger();
}
void stop()
{
player.close();
kick.close();
minim.stop();
super.stop();
}
«Prev
Next »
Moderate user : asm0de0
Forum