Jump to content

  • Log In with Google      Sign In   
  • Create Account


henrykl

Member Since 17 Jun 2012
Offline Last Active Jul 10 2013 05:08 AM
-----

Posts I've Made

In Topic: Simple Binary File I/O question

10 July 2013 - 05:08 AM

Yes, for the most part the code is the same minus the binary flag and the ".mesh". And yes the BinOut does fail


In Topic: Need Help making a good particle engine

13 November 2012 - 01:55 PM

Thanks for the tips. And yea i have been looking for tutorials but all they do is confuse me

In Topic: optimizing code for first game

17 July 2012 - 05:08 PM

public static void fightTech()
{
boolean fight_tech = true;
int basedamage = hero_strength - s_defense;
final int LOWF = 1;
int damage = (int)(Math.random() * (basedamage - s_defense + 1)) + LOWF;
final int HIGHF = 20;
int ROLLF = (int)(Math.random() * 20) + 1;
int crithit = basedamage * 2;

while (fight_tech)
{
if (ROLLF = 14 && ROLLF =19)
{
System.out.println("Critical hit!!!!!");
s_health = s_health - crithit;
System.out.println("Slime has " + s_health + " health left");
slimeAttack();
}
System.out.println("Slime has " + s_health + " health left");
}
}
public static void defendTech()
{
final int LOWD = 1;
final int HIGHD = 10;
final int ROLLD = (int)(Math.random() * (HIGHD - LOWD + 1)) + LOWD;
if (ROLLD =4 && ROLLD < 10)
{
System.out.println("Close but not close enough. You only blocked 25% of damage.");
}
else if (ROLLD == 10)
{
System.out.println("You managed to roll out of the way. Took no damage");
}
}

a few things i saw:
In fight_tech() :
the fight_tech boolean is never set to false.
You have an if check that sets ROLLF 14 and 19 every iteration

in defense_tech();
simialr situation you have an if check that sets ROLLD to 4 every iteration

In Topic: creating Particle system. problem with the spread

17 June 2012 - 11:21 AM

Thank you so much the static cast was exactly what i needed.

PARTNERS