henrykl

Member
  • Content count

    7
  • Joined

  • Last visited

Community Reputation

117 Neutral

About henrykl

  • Rank
    Newbie
  1. Simple Binary File I/O question

    Yes, for the most part the code is the same minus the binary flag and the ".mesh". And yes the BinOut does fail
  2. I am currently writing a Maya exporter. i already got it working in .xml format but im trying to port it over to a binary file. When I try to create the binary file it always fails. Any Ideas on why this might be:   string path = writeOutMesh.m_strName + ".mesh"; std::ofstream BinOut; BinOut.open(path.c_str(),std::ios_base::binary | std::ios_base::trunc);   if( !BinOut.is_open() ) return;   It always hits the return. Any help will be much appreciated  Thanks 
  3. Need Help making a good particle engine

    Thanks for the tips. And yea i have been looking for tutorials but all they do is confuse me
  4. I have been trying to make a particle engine for a while now. i think i understand the base mechanics behind it but i can't seem to put it together. my end goal would be to a particle engine based in drx9 that uses shaders. So if anyone could point me in the direction of a simple particle engine tutorial or on here i would greatly appreciate it. another question if doing particle with shaders the only thing that would get update c++ side would be the position right???
  5. optimizing code for first game

    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
  6. Thank you so much the static cast was exactly what i needed.
  7. Hello all, i have been working on a particle system for a while now, but its just not coming together the way i need it too. i am at my wits end with it. the main prblem i have is that my spread doesnt spread at all, it lingers trailing behind the object its attached to. heres how i start it p->SetDirection ( Vector2D_Rotate(direction,DegreesToRadians(float(rand() % int(Spreadrate))))); pos.fX =(float) m_vStartPosX; pos.fY =(float) m_vStartPosY; p->setPosition(pos); and its update m_vPosition.fX += Direction.fX * m_vVelocity.fX * dt; m_vPosition.fY += Direction.fY * m_vVelocity.fY * dt; any help would be much appreciated