Two hours of my life.....

The "I'm Thinking" now thread
Post Reply
User avatar
boabyfett
Vyvyan Basterd
Posts: 4701
Joined: Tue Dec 06, 2005 10:47 pm
Location: In front of my pc forever learning java.

Two hours of my life.....

Post by boabyfett »

on a friday nite too

/**
* A method which overwrites the inherited equals()
* method. The method returns false if object is not a
* ColourBlindHoverFrog and if the object is a ColourBlindHoverFrog
* it then compares height and position of the
* ColourBlindHoverFrogs.
*/
public boolean equals(Object obj)
{

if (obj instanceof ColourBlindHoverFrog)
{
ColourBlindHoverFrog cbhf = (ColourBlindHoverFrog) obj;
return (this.getHeight() == cbhf.getHeight() && this.getPosition() == cbhf.getPosition());
}

else
{
return false;
}
}


I better get a bloody A. Now here goes my saterday.
B

Image

"This calls for a delicate blend of psychology and extreme violence."
Haviland
Volvo-Driving Soccer Mom
Posts: 8664
Joined: Fri Jul 14, 2006 9:12 am
Location: Secret Bar of Evil

Re: Two hours of my life.....

Post by Haviland »

"HoverFrog"

Just what the fuck are you developing? Or smoking?
Image
User avatar
boabyfett
Vyvyan Basterd
Posts: 4701
Joined: Tue Dec 06, 2005 10:47 pm
Location: In front of my pc forever learning java.

Re: Two hours of my life.....

Post by boabyfett »

a small game where hoverfrog can be at a set position between 1 and 12 and height between 1 and 6.

i need to get a frog to land on another frog. so i have to find out if they are equal. but colour doesnt count so i have to over write the hashCode() and equals() methods inherint to all objects. so that the hover frogs can ignore colour and find out if they occupy the same space. (basic collision detection).

java tastic.ive worked out how to overwrite the hashcode:

/*** A method which overwrites the inherited
* hashCode() method.
*/
public int hashCode()
{
return ((this.getPosition()*10) + this.getHeight());
}

im now generating a loop which makes hover frogs in every position twice to test the game. thats work 5 marks and im done q1 of 4. (q1 is worth a third of the paper)

fun weekend im having :)
B

Image

"This calls for a delicate blend of psychology and extreme violence."
Wyvern
Captain Pugwash
Posts: 5818
Joined: Mon Dec 05, 2005 9:54 pm
Location: At the helm of Thunderchild

Re: Two hours of my life.....

Post by Wyvern »

So, you're currently at the 1980s stage in game development; when can we expect "Half Life: Episode Boaby"?
They got things like the atom bamb... so I'm gonna stay where I... AM!
User avatar
boabyfett
Vyvyan Basterd
Posts: 4701
Joined: Tue Dec 06, 2005 10:47 pm
Location: In front of my pc forever learning java.

Re: Two hours of my life.....

Post by boabyfett »

same time duke nukem forever is out.
B

Image

"This calls for a delicate blend of psychology and extreme violence."
Haviland
Volvo-Driving Soccer Mom
Posts: 8664
Joined: Fri Jul 14, 2006 9:12 am
Location: Secret Bar of Evil

Re: Two hours of my life.....

Post by Haviland »

boabyfett wrote:a small game where hoverfrog can be at a set position between 1 and 12 and height between 1 and 6.

i need to get a frog to land on another frog. so i have to find out if they are equal. but colour doesnt count so i have to over write the hashCode() and equals() methods inherint to all objects. so that the hover frogs can ignore colour and find out if they occupy the same space. (basic collision detection).

java tastic.ive worked out how to overwrite the hashcode:

/*** A method which overwrites the inherited
* hashCode() method.
*/
public int hashCode()
{
return ((this.getPosition()*10) + this.getHeight());
}

im now generating a loop which makes hover frogs in every position twice to test the game. thats work 5 marks and im done q1 of 4. (q1 is worth a third of the paper)

fun weekend im having :)
Why not something like

if (frog[x] && frog[y])
then
call tadpoles(frog[x],frog[y])
else
assert("GAY FROGS!!!!")
endif
Image
Dunwa
The Taker Of The Holy Tags and Bar
Posts: 4390
Joined: Tue Dec 06, 2005 7:56 pm
Location: xǝɹnoɟ

Re: Two hours of my life.....

Post by Dunwa »

Image
Dunwa Arche
User avatar
boabyfett
Vyvyan Basterd
Posts: 4701
Joined: Tue Dec 06, 2005 10:47 pm
Location: In front of my pc forever learning java.

Re: Two hours of my life.....

Post by boabyfett »

ROFL
B

Image

"This calls for a delicate blend of psychology and extreme violence."
Post Reply