Page 1 of 1

Two hours of my life.....

Posted: Sat May 10, 2008 10:21 am
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.

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

Posted: Sat May 10, 2008 11:00 am
by Haviland
"HoverFrog"

Just what the fuck are you developing? Or smoking?

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

Posted: Sat May 10, 2008 11:06 am
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 :)

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

Posted: Sat May 10, 2008 11:07 am
by Wyvern
So, you're currently at the 1980s stage in game development; when can we expect "Half Life: Episode Boaby"?

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

Posted: Sat May 10, 2008 11:09 am
by boabyfett
same time duke nukem forever is out.

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

Posted: Sat May 10, 2008 1:52 pm
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

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

Posted: Sat May 10, 2008 5:08 pm
by Dunwa
Image

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

Posted: Sat May 10, 2008 5:36 pm
by boabyfett
ROFL