|
|
|||||||
| Computers & Information Technologies « Everything related to computers and internet. » |
![]() |
|
|
Share | Thread Tools | Search this Thread |
|
|
#1 |
|
Vcoderz Team
Last Online: 09-03-2014
Join Date: Jan 2009
Posts: 1,438
Thanks: 776
Thanked 1,299 Times in 786 Posts
Groans: 1
Groaned at 1 Time in 1 Post
|
Processing is an open source programming language and environment for people who want to program images, animation, and interactions.
http://www.processing.org I am currently studying programming languages and one of them is Processing, it is based on Java (basically the same). It is a new programming language they introduced at my university this year. Any of you studied/used it before? What is the most used programming language nowadays? |
|
|
|
| The Following User Says Thank You to 7alewi For This Useful Post: | Google (11-16-2009) |
|
|
#2 |
|
Last Online: 05-30-2013
Join Date: Jan 2008
Posts: 1,788
Thanks: 10,018
Thanked 1,100 Times in 651 Posts
Groans: 1
Groaned at 6 Times in 6 Posts
|
This language looks cool.
If you have any online e-books used by your university to teach it, then link me please.
__________________
|
|
|
|
|
|
#3 | |
|
Last Online: 12-20-2021
Join Date: Mar 2006
Posts: 6,245
Thanks: 2,121
Thanked 3,365 Times in 1,740 Posts
Groans: 29
Groaned at 44 Times in 35 Posts
|
Quote:
__________________
What we do in life, echoes in eternity.
|
|
|
|
|
| The Following User Says Thank You to Tawa For This Useful Post: | Google (11-17-2009) |
|
|
#4 |
|
Last Online: 05-30-2013
Join Date: Jan 2008
Posts: 1,788
Thanks: 10,018
Thanked 1,100 Times in 651 Posts
Groans: 1
Groaned at 6 Times in 6 Posts
|
Actually, this is the future of the web...
I'm currently integrating ProcessingJS in web-pages using HTML5 canvas tag. I'm coding something now, I will post it here when I finish...
__________________
|
|
|
|
|
|
#5 | |
|
Vcoderz Team
Last Online: 09-03-2014
Join Date: Jan 2009
Posts: 1,438
Thanks: 776
Thanked 1,299 Times in 786 Posts
Groans: 1
Groaned at 1 Time in 1 Post
|
Quote:
Seriously I find it so interesting! Well its my first year so we are studying the basics.. the book we use is called: Learning Processing: A Beginner's Guide to Programming Images. Download from HERE. I am currently trying to create a game in processing (part of our project), I will post the code when I'm done! ![]() Edit: By the way you can browse THIS website for some sketches done using processing Last edited by 7alewi; 11-17-2009 at 06:49 PM. Reason: Added sketches website |
|
|
|
|
| The Following User Says Thank You to 7alewi For This Useful Post: | Google (11-18-2009) |
|
|
#6 |
|
Last Online: 05-30-2013
Join Date: Jan 2008
Posts: 1,788
Thanks: 10,018
Thanked 1,100 Times in 651 Posts
Groans: 1
Groaned at 6 Times in 6 Posts
|
Look at the bottom left side of this page.
I coded this watch using ProcessingJS and embedded it in the page using Canvas HTML5 tag.
__________________
|
|
|
|
|
|
#7 | |
|
Vcoderz Team
Last Online: 09-03-2014
Join Date: Jan 2009
Posts: 1,438
Thanks: 776
Thanked 1,299 Times in 786 Posts
Groans: 1
Groaned at 1 Time in 1 Post
|
Quote:
that was fast lol nice one |
|
|
|
|
|
|
#8 |
|
Vcoderz Team
Last Online: 09-03-2014
Join Date: Jan 2009
Posts: 1,438
Thanks: 776
Thanked 1,299 Times in 786 Posts
Groans: 1
Groaned at 1 Time in 1 Post
|
Im stuck
![]() I wrote the following code, I used classes to state the variables and then I used an array which calls the class everytime it needs to draw the object (circle). In the program, the array is written in the sketch and then I added a Tab to the sketch (named it Ball), and worte the class in the added Tab. P.S: If I put this whole code in one sketch without the "Tab" it works! But if I try to do it the same way done in the book (Using Tab) it doesn't work. It says: "Cannot find class or type named Ball" Any idea? ThanksClass (In Tab named "Ball") Code:
class Ball {
color r;
color o;
color g;
float xPos;
float yPos;
float xSpeed;
float xSize;
float ySize;
Ball() {
r = color (196,18,18);
o = color (227,144,18);
g = color (19,157,52);
xPos = height/2;
yPos = width/2;
xSpeed = 1;
xSize = 80;
ySize = 80;
}
}
Array (In original sketch) Code:
Ball[] myball = new Ball[100];
void setup() {
size(400,400);
smooth();
for (int i = 0; i < myball.length; i ++ ) {
myball[i] = new Ball(color(i*2),0,i*2,i/20.0);
}}
void draw() {
background(50);
for (int i = 0; i < myball.length; i ++ )
{
myball[i].move();
myball[i].display();
}
}
}
|
|
|
|
|
|
#9 |
|
Last Online: 05-30-2013
Join Date: Jan 2008
Posts: 1,788
Thanks: 10,018
Thanked 1,100 Times in 651 Posts
Groans: 1
Groaned at 6 Times in 6 Posts
|
You need to import the class file.
Syntax: import CLASS_NAME
__________________
|
|
|
|
| The Following User Says Thank You to Google For This Useful Post: | 7alewi (12-22-2009) |
|
|
#10 |
|
Vcoderz Team
Last Online: 09-03-2014
Join Date: Jan 2009
Posts: 1,438
Thanks: 776
Thanked 1,299 Times in 786 Posts
Groans: 1
Groaned at 1 Time in 1 Post
|
Try to run this
![]() Code:
PFont fontA;
int sphereDiameter = 10;
boolean shoot = false;
int randx()
{
return int(random(600));
}
int[] sphereXCoords = { randx(), randx(), randx(), randx(), randx() };
int[] sphereYCoords = { 0, 0, 0, 0, 0 };
void setup()
{
size(600,620);
}
void draw()
{
background(0);
fill(color(0,255,0));
stroke(color(0,255,0));
triangle(mouseX-8, 580, mouseX+8, 580, mouseX, 565);
fill(color(255,0,0));
stroke(color(255,0,0));
if(shoot==true)
{
sphereKiller(mouseX);
shoot = false;
}
sphereDropper();
gameEnder();
}
void mousePressed()
{
shoot = true;
}
void sphereDropper()
{
stroke(255);
fill(255);
for (int i=0; i<5; i++)
{
ellipse(sphereXCoords[i], sphereYCoords[i]++,
sphereDiameter, sphereDiameter);
}
}
void sphereKiller(int shotX)
{
boolean hit = false;
for (int i = 0; i < 5; i++)
{
if((shotX >= (sphereXCoords[i]-sphereDiameter/2)) &&
(shotX <= (sphereXCoords[i]+sphereDiameter/2)))
{
hit = true;
line(mouseX, 565, mouseX, sphereYCoords[i]);
ellipse(sphereXCoords[i], sphereYCoords[i],
sphereDiameter+25, sphereDiameter+25);
sphereXCoords[i] = randx();
sphereYCoords[i] = 0;
}
}
if(hit == false)
{
line(mouseX, 565, mouseX, 0);
}
}
void gameEnder()
{
for (int i=0; i< 5; i++)
{
if(sphereYCoords[i]==600)
{
fill(color(255,0,0));
noLoop();
}
}
}
|
|
|
|
| The Following User Says Thank You to 7alewi For This Useful Post: | Tawa (12-29-2009) |
![]() |
|
| Tags |
| language, processing, programming |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|