Recent posts by ETHANR26 on Kongregate

Flag Post

Topic: Game Programming / JAVA Classes and Objects and things

Originally posted by UnknownGuardian:

In BjueJ, when you finish typing each seperate class, you right click the test class box, and click the option “void main string args[]” and it will run exactly what you wrote. However if you don’t display(print) anything, the program will run and close immediately, since no data needs to be outputed. (it still runs, except to fast for human eye to see.)

Thank you, I actually do like this much better!

 
Flag Post

Topic: Game Programming / JAVA Classes and Objects and things

If I’m using BlueJ, how on

Originally posted by UnknownGuardian:

I’m sure that a beginner in Java would hardly understand what you are talking about…and I’m not even sure what you are talking about…


anyway, as notallama pointed out, bluej is one of the best, or is the best.

It seems pretty nice, but how do you actually run the code?

 
Flag Post

Topic: Game Programming / JAVA Classes and Objects and things

I think my above post addressed it, however, its good to point that out, because I edited my above post after he quoted it…

Sorry, didn’t see that, thanks though.

Here’s my Test class now, can you guys make sure there are no more careless errors in it? (it runs perfectly)


import java.util.Scanner;
public class Test
{
public static void main(String[] args)
{
int sides;
System.out.print("How many sides does your die have? “);
Scanner scan = new Scanner (System.in);
sides = scan.nextInt();
Die die1 = new Die(sides);
die1.roll();
int value = die1.getFaceValue();
System.out.println(”You rolled a " + value);
}
}

you should try this:
http://www.bluej.org/

I’ll try that, thanks.

 
Flag Post

Topic: Game Programming / JAVA Classes and Objects and things

Originally posted by Jabor:

You’re typing Die.getFaceValue(), right?

You shouldn’t be doing that. You should be writing myDieVariable.getFaceValue() (replacing myDieVariable with what you’re actually using – so it reads e.g. die1.getFaceValue())

I actually did something completely different but just as wrong, I suppose.Thanks though, that cleared up my error.

 
Flag Post

Topic: Game Programming / JAVA Classes and Objects and things

Originally posted by UnknownGuardian:

So are you ever going to type any code into a computer, or is your class going to write it down for the rest of the year?(Not talking about this piece, I’m talking about in general, do you type any code in a computer?) If you do, it makes it easier to catch errors and read your code. If you want I can point you to a great free compiler/program that makes running Java a snap.

We never write anything down at all, it’s all in computers, and if the compiler isn’t JCreator LE, that would be great, I don’t like JCreator that much. I also seem to have just run into the problem of not being able to reference getFaceValue(); from my Test class, because it ‘Cannot be referenced from a static context’ any idea on how to fix that?

EDIT: Sorry it’s taking me so long to answer, my internet is terrible…

And my class extends die because I thought that that was what made it run after die, for whatever reason…

 
Flag Post

Topic: Game Programming / JAVA Classes and Objects and things

Originally posted by UnknownGuardian:

Well, to print things to a screen, you use the method System.out.println(). Inside of the () you put what you want to be printed to the screen, with “+” seperating them. For example,

System.out.println(10);  //prints 10

int num = getFaceValue();
System.out.println(num);  //prints num, or essentially getFaceValue();

ah, I knew how to println, I just didn’t know how to get the value into something usable for my test code.

 
Flag Post

Topic: Game Programming / JAVA Classes and Objects and things

Originally posted by UnknownGuardian:

Any more questions? Things you don’t quite get?

EDIT: Are you actually running the code you write? Or are you just keeping it all on paper?

I’m writing it all down.

 
Flag Post

Topic: Game Programming / JAVA Classes and Objects and things

My next question is, How do I make it print the faceValue number stored in it after I call the roll() function?

 
Flag Post

Topic: Game Programming / JAVA Classes and Objects and things

Originally posted by UnknownGuardian:
Originally posted by Jabor:


I want it to declare the number of sides to the value stored in sides after it reads the scanner input. As I said, I have NO idea of what I’m doing at all…

Here is the official tutorial on constructors.

And then you could read what I wrote…

Got it that part down, thank you, and Jabor!

 
Flag Post

Topic: Game Programming / JAVA Classes and Objects and things

Originally posted by Jabor:

Die die1.(sides faces);

I’m curious as to what you want this line to do.

I want it to declare the number of sides to the value stored in sides after it reads the scanner input. As I said, I have NO idea of what I’m doing at all…

 
Flag Post

Topic: Game Programming / JAVA Classes and Objects and things

I'm going through an AP Computer Science course at my high school, and my teacher knows nothing about coding, and the book isn't helping at all. Any chance someone could help me with this? I have this generic class (below) which presumably is for making objects that simulate a die, and I'm trying to make an object of that class that lets me choose what number of sides the die has, and roll it, which the class should help do, with the class below the firest one... If anyone could help, it would be greatly appreciated.
//********************************************************************
//  Die.java       Author: Lewis/Loftus/Cocking
//
//  Solution to Programming Project 4.4
//
//  Represents one die (singular of dice) with faces showing values
//  between 1 and the number of faces on the die.
//********************************************************************

public class Die
{
   private final int MIN_FACES = 4;

   private int numFaces;   // number of sides on the die
   private int faceValue;  // current value showing on the die

   //-----------------------------------------------------------------
   //  Defaults to a six-sided die, initially showing 1.
   //-----------------------------------------------------------------
   public Die ()
   {
      numFaces = 6;
      faceValue = 1;
   }

   //-----------------------------------------------------------------
   //  Explicitly sets the size of the die. Defaults to a size of
   //  six if the parameter is invalid.  Initial face is 1.
   //-----------------------------------------------------------------
   public Die (int faces)
   {
      if (faces < MIN_FACES)
         numFaces = 6;
      else
         numFaces = faces;

      faceValue = 1;
   }

   //-----------------------------------------------------------------
   //  Rolls the die and returns the result.
   //-----------------------------------------------------------------
   public int roll ()
   {
      faceValue = (int) (Math.random() * numFaces) + 1;
      return faceValue;
   }

   //-----------------------------------------------------------------
   //  Returns the current die value.
   //-----------------------------------------------------------------
   public int getFaceValue ()
   {
      return faceValue;
   }
}
My attempt...:
import java.util.Scanner;
public class Test extends Die
{
	public static void main(String[] args)
	{
		int sides;
		Scanner scan = new Scanner (System.in);
		sides = scan.nextInt();
		Die die1;
		Die die1.(sides faces);
	}
}
 
Flag Post

Topic: Off-topic / Choose your own Adventure!

Screw your little quest for now, DANCE PARTY!

 
Flag Post

Topic: Off-topic / The Hunt for the Mod Crown

Is this story ever going to be anything more than ridiculous eating of people?

 
Flag Post

Topic: Game Programming / AS2 spawning multiple instances of a class in different spots

No…It’s like space invaders, as i said. They move the same, they die the same, etc etc etc.

 
Flag Post

Topic: Game Programming / AS2 spawning multiple instances of a class in different spots

Say what what? They are all going to do the same thing.

 
Flag Post

Topic: Game Programming / AS2 spawning multiple instances of a class in different spots

It’s one class, so an array wouldn’t help much…

 
Flag Post

Topic: Game Programming / AS2 spawning multiple instances of a class in different spots

Hmmm…That looks like it should work..I’ll give it a shot.

 
Flag Post

Topic: Game Programming / AS2 spawning multiple instances of a class in different spots

I can’t think of a way to spawn multiple enemies of the same class in a way similar to space invaders. Any help?

 
Flag Post

Topic: Off-topic / Madtracker 2 Instruments

Originally posted by Carados:
Originally posted by ETHANR26:

Man, copyright fucks up everything these days…

I’m sure I would want to spend hours recording every possible note an instrument would make using high quality microphones and equipment in a good sounding room, fill out oodles of paper-work dealing with licensing the track to anyone who buys it, only to give it away for free.

Surely they wouldn’t have to fill out the paper work to license it if they were giving it away for free.

 
Flag Post

Topic: Off-topic / Madtracker 2 Instruments

Man, copyright fucks up everything these days…

 
Flag Post

Topic: Off-topic / Madtracker 2 Instruments

A while back, I downloaded the free software program “Madtracker 2” for windows, and just recently I really started using it. One of my biggest problems though, is the lack of instruments included. Does anyone out there use this program and/or know where I can download some instruments for it? (yes, I HAVE checked google.)

 
Flag Post

Topic: Off-topic / Can I move here from the SD forum? They hate me. 8(

Originally posted by Vanguarde:

I have not abandoned all of you..

I am writing out my epic reply to this thread.

Also, stop harassing others by accusing them of being me as an ‘alt’. I don’t use alts at the same time – even though I have 8 alts ready to go if this account is banned.

I will say also one quick thing to kingzak13 and all of his ‘followers’..

kingzak13 your days are numbered as the ‘king’ of OT. You have no idea how insane I am.

Finally, you all claim I lack respect, yet you failed to respect me in regards to me ASKING all of you if I am welcome here.

Who else does that, ask the current forum if it’s ok for one to post on it?

Show some love.

Epic post coming soon..

( People who know Vanguarde know how good my epic posts are.. )

You’re ignorance is treason.

 
Flag Post

Topic: Kongregate / Kongregate Account "Upgrades"?

Originally posted by UploaderX:

Yea I like your Idea but the preminum feature if Kongregate have this They Need Money,without money like for example Kongregatr dosent have lots of money they can be bankruped and you wont ger points/money when you upload a game and Kongregate Website Can be shutted Down.

test[/url]

I can’t even understand what you are saying..

 
Flag Post

Topic: Kongregate / Kongregate Account "Upgrades"?

If it’s an On-Game fee, it’s ok, but if it’s a kong account upgrade, then it’s not.

 
Flag Post

Topic: Kongregate / You can mute mods??

I’m really trying, but I can’t understand a giggly darn thing that’s coming out of your mouth…