Java: BlueJ251

How To's, Questions, and Solutions for problems. This covers anything from computer hardware problems to software recommendations to tutorials for various software programs.

Note: Neither Gametoast nor any of its members/visitors are responsible for any damage to your computer as a result from advice given in this forum. Follow advice at your own risk and be sure to back up any important files.

Moderator: Moderators

Post Reply
User avatar
Anakin
Master of the Force
Master of the Force
Posts: 4817
Joined: Sat Sep 19, 2009 11:37 am
Projects :: RC Side Mod - Remastered - SWBF3 Legacy
Location: Mos Espa (germany)

Java: BlueJ251

Post by Anakin »

is there some one who knows how i can
load soundfiles to BlueJ projekts,
make my own windows,
to compile the projekt so that the program can run on pc without BlueJ??
501st_commander
Master Bounty Hunter
Master Bounty Hunter
Posts: 1570
Joined: Wed Dec 10, 2008 7:48 pm

Re: Java: BlueJ251

Post by 501st_commander »

...

define "make my own windows".
User avatar
Anakin
Master of the Force
Master of the Force
Posts: 4817
Joined: Sat Sep 19, 2009 11:37 am
Projects :: RC Side Mod - Remastered - SWBF3 Legacy
Location: Mos Espa (germany)

Re: Java: BlueJ251

Post by Anakin »

in german Fenster
every program is in one window(Fenster) like FireFox or Windows media Player txt-editor, word...
computergeek
General
General
Posts: 770
Joined: Thu Jun 07, 2007 6:26 pm
Projects :: Halo Warthog vehicle for SWBF2
Games I'm Playing :: Bioware RPGs - Halo
xbox live or psn: No gamertag set
Location: Far Far away....

Re: Java: BlueJ251

Post by computergeek »

Anakin wrote:in german Fenster
every program is in one window(Fenster) like FireFox or Windows media Player txt-editor, word...
Maybe this will help you?
User avatar
Anakin
Master of the Force
Master of the Force
Posts: 4817
Joined: Sat Sep 19, 2009 11:37 am
Projects :: RC Side Mod - Remastered - SWBF3 Legacy
Location: Mos Espa (germany)

Re: Java: BlueJ251

Post by Anakin »

what i mean:
here is my programm:
how can i make a winow so that the player can choose the coulor of the ball?
how can i load a sound file so that for example if the player wins the yoda song runs?
and is it posible to compile the program so that someone else can run it without blueJ.
Hidden/Spoiler:
//Minigolf1.0
import sum.kern.*;
// import sum.multimedia.*;
/**
* @author
* @version
*/

public class Minigolf
{
// Objekte
sum.kern.Bildschirm derBildschirm;
sum.kern.Buntstift meinStift;
sum.kern.Maus dieMaus;
sum.kern.Tastatur dieTastatur;
sum.multimedia.Ton derTon;

// Konstruktor
public Minigolf()
{
derBildschirm = new sum.kern.Bildschirm(700,700);
meinStift = new sum.kern.Buntstift();
dieMaus = new sum.kern.Maus();
dieTastatur = new sum.kern.Tastatur();
derTon = new sum.multimedia.Ton();
fuehreAus();
}

// Dienste
public void zeichneLoch()
{
meinStift.runter();
meinStift.setzeFuellmuster(1);
meinStift.zeichneKreis(5);
meinStift.hoch();
}

public void zeichneKugel()
{
meinStift.runter();
meinStift.setzeFuellmuster(1);
meinStift.zeichneKreis(4.5);
meinStift.hoch();
}

public void rolleKugel()
{
meinStift.runter();
meinStift.radiere();
zeichneKugel();
meinStift.normal();
meinStift.bewegeUm(-0.25);
zeichneKugel();
meinStift.hoch();
}

public void spielFeld()
{
derBildschirm.setzeFarbe(5);
meinStift.setzeLinienBreite(5);
meinStift.hoch();
meinStift.bewegeBis(300,450);
meinStift.runter();
meinStift.bewegeBis(300,50);
meinStift.bewegeBis(400,50);
meinStift.bewegeBis(400,450);
meinStift.setzeLinienBreite(1);
meinStift.hoch();
}

public void fuehreAus()
{
//Aktionsteil
int Punkte;
int Versuche;
char z='q';
Punkte = 0;
Versuche = 0;

do{
meinStift.setzeFarbe(0);
spielFeld();
meinStift.bewegeBis(2,690);
meinStift.schreibeText("Punkte:"+Punkte+""+"Versuche:"+Versuche);
meinStift.bewegeBis(350,100);
zeichneLoch();
meinStift.bewegeBis(350,400);
meinStift.setzeFarbe(1);
zeichneKugel();
do{
meinStift.runter();
meinStift.dreheZu(dieMaus.hPosition(),dieMaus.vPosition());
meinStift.bewegeUm(-30);
meinStift.radiere();
meinStift.bewegeUm(30);
meinStift.normal();
zeichneKugel();
}while(!dieMaus.istGedrueckt());
meinStift.bewegeBis(350,400);
do{
rolleKugel();
if(meinStift.hPosition()>345 && meinStift.hPosition()<355 && meinStift.vPosition()==100)
{
Punkte = Punkte + 1;
Versuche = Versuche + 1;
meinStift.bewegeBis(320,350);
meinStift.schreibeText("Eingelocht!");
meinStift.hoch();
meinStift.bewegeBis(320,370);
meinStift.schreibeText("Nochmal?J=Ja N=Nein");
while(!dieTastatur.wurdeGedrueckt()){};
z = dieTastatur.zeichen();
switch (z)
{
case 'n': case 'N': System.exit(0);break;
case 'j': case 'J': break;
}
dieTastatur.weiter();
break;
}
}while(meinStift.hPosition()>304.75 && meinStift.hPosition()<395.25 && meinStift.vPosition()>54.75 && meinStift.vPosition()<445.25);

Versuche = Versuche + 1;
meinStift.bewegeBis(320,350);
meinStift.schreibeText("Leider daneben!");


}while(z!=527);
System.exit(0);

//Aufraeumen
meinStift.gibFrei();
derBildschirm.gibFrei();
}
}
501st_commander
Master Bounty Hunter
Master Bounty Hunter
Posts: 1570
Joined: Wed Dec 10, 2008 7:48 pm

Re: Java: BlueJ251

Post by 501st_commander »

woah, i think you may not get too much help on that type program :?
unless its php, then i can help a ton :D
User avatar
Anakin
Master of the Force
Master of the Force
Posts: 4817
Joined: Sat Sep 19, 2009 11:37 am
Projects :: RC Side Mod - Remastered - SWBF3 Legacy
Location: Mos Espa (germany)

Re: Java: BlueJ251

Post by Anakin »

i think too


EDIT
hey i read the book OOP online. the problem is there are only the first 6 kapitle online.
did someone knows where i can find the kapitle 7??

or did someone knows how to do this:

here is the main program.
this says to the class "kugel" where the "Stift" from the class should paint the "kugel".
how can i make the class to catch the hPosition(); and vPosition(); from the main programm??
501st_commander
Master Bounty Hunter
Master Bounty Hunter
Posts: 1570
Joined: Wed Dec 10, 2008 7:48 pm

Re: Java: BlueJ251

Post by 501st_commander »

try a BlueJ251 forum. I dont think anyone here knows anything on this type program.
Post Reply