Vcoderz Community
We create websites that have it all, beauty & brains
Lebanon Web Design & Development - Coddict
 

Go Back   Vcoderz Community > Computer Zone > Computers & Information Technologies

Notices

Computers & Information Technologies « Everything related to computers and internet. »

Reply
 
Share Thread Tools Search this Thread
Old 11-16-2009   #1
7alewi
Vcoderz Team
 
7alewi's Avatar
 
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
Default Processing - Programming Language

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?


7alewi is offline   Reply With Quote
The Following User Says Thank You to 7alewi For This Useful Post:
Google (11-16-2009)
Old 11-16-2009   #2
Google

 
Google's Avatar
 
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
Default

This language looks cool.
If you have any online e-books used by your university to teach it, then link me please.
__________________

Google is offline   Reply With Quote
Old 11-17-2009   #3
Tawa
 
Tawa's Avatar
 
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
Default

Quote:
Originally Posted by Google View Post
This language looks cool.
If you have any online e-books used by your university to teach it, then link me please.
Yes, please do link him, and soon, he will be teaching it in Balamand.
__________________
What we do in life, echoes in eternity.
Tawa is offline   Reply With Quote
The Following User Says Thank You to Tawa For This Useful Post:
Google (11-17-2009)
Old 11-17-2009   #4
Google

 
Google's Avatar
 
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
Default

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...
__________________

Google is offline   Reply With Quote
Old 11-17-2009   #5
7alewi
Vcoderz Team
 
7alewi's Avatar
 
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
Default

Quote:
Originally Posted by Google View Post
This language looks cool.
If you have any online e-books used by your university to teach it, then link me please.

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
7alewi is offline   Reply With Quote
The Following User Says Thank You to 7alewi For This Useful Post:
Google (11-18-2009)
Old 11-18-2009   #6
Google

 
Google's Avatar
 
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
Default

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.
__________________

Google is offline   Reply With Quote
Old 11-18-2009   #7
7alewi
Vcoderz Team
 
7alewi's Avatar
 
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
Default

Quote:
Originally Posted by Google View Post
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.
wow that was fast lol nice one
7alewi is offline   Reply With Quote
Old 12-22-2009   #8
7alewi
Vcoderz Team
 
7alewi's Avatar
 
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
Default

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? Thanks


Class (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();
    }
  }
}
7alewi is offline   Reply With Quote
Old 12-22-2009   #9
Google

 
Google's Avatar
 
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
Default

You need to import the class file.
Syntax: import CLASS_NAME
__________________

Google is offline   Reply With Quote
The Following User Says Thank You to Google For This Useful Post:
7alewi (12-22-2009)
Old 12-29-2009   #10
7alewi
Vcoderz Team
 
7alewi's Avatar
 
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
Default

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();
      }
    }
  }
7alewi is offline   Reply With Quote
The Following User Says Thank You to 7alewi For This Useful Post:
Tawa (12-29-2009)
Reply

  Vcoderz Community > Computer Zone > Computers & Information Technologies

Tags
language, processing, programming



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:53 AM.


Lebanon web design and development
Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Share