GeoKureli

Member
  • Content count

    4
  • Joined

  • Last visited

Community Reputation

113 Neutral

About GeoKureli

  • Rank
    Newbie
  1. Flash(Punk) Low FPS issues

    60 fps is not usually what flash games operate at. You're better off going with 30. I've never used Flashpunk but I've used Flixel, and one is based on the other(I forget which). but one mistake I made with Flixel was not doing collision through groups. you can add all your assets to the same object, but things like coins should have a group that they are all in, even if that group is not displayed. groups are quad trees and handle collision lightning fast. Again, this is Flixel I'm talking about, so it may not apply
  2. Just wondering if anyone knows how to check the input from the RB3 keytar. The only thing I could find on google was this forum. [url="http://xboxforums.create.msdn.com/forums/p/71386/584884.aspx"]http://xboxforums.create.msdn.com/forums/p/71386/584884.aspx[/url] It's a start, but I'm just wondering if anyone knows of an existing library that could handle this? Otherwise if I figure it out I'll post something here. P.S. Is it legal to make a game that uses a rock band peripheral?
  3. Thanks guys, it works great, and your suggestions added a lot of flair to the image. the issue was with: [CODE]d3ddev->SetRenderState(D3DRS_ZWRITEENABLE, false);[/CODE] and these really made it look great! [CODE]d3ddev->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_ONE); d3ddev->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_ONE);[/CODE]
  4. I've included pictures of whats happening as well as my "particle" image. The issue is i have a bunch a billboards showing a particle, but the alpha doesn't seem to be working in some cases, but it works in some cases. for instance if i stack the particleThis is an assignment I have for class [source lang="cpp"] // render the grid d3ddev->SetRenderState(D3DRS_ALPHABLENDENABLE, FALSE); render_grid(); d3ddev->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE); // calculate elapsed time static DWORD starting_point = GetTickCount(), time; time = GetTickCount() - starting_point; starting_point = GetTickCount(); addParticles(); // prepare particle for rendering Node<Particle> *particle = particles.first; D3DXMATRIX patMat; float y = 0; while (particle != NULL){ particle->value->run_particle(time / 1000.0f); //particle->value->position.y = y; if(particle->value->isDead()) particle->value->reset(); patMat = particle->value->set_particle(camx, camy, camz); d3ddev->SetTransform(D3DTS_WORLD, &patMat); particle->value->render_particle(); // --- NEXT particle = particle->next; y += .05; } d3ddev->EndScene(); [/source] "particles" is a linked list, addparticles adds some particles to the list until the cap is reached, and when particle die they get reset. when i draw X amount of the particles at the same position, they all draw, andit looks like a brighter version of the particle, however when i move them randomly they loook like the images below heres the particle class: [source lang="cpp"]#include <d3dx9.h> float random(float max, bool negative = true){ if(negative) return cos(float(rand()))*max; /*else*/ return abs(cos(float(rand())))*max;} // the Particle class class Particle{ protected: D3DXVECTOR3 velocity; D3DXVECTOR3 acceleration; float radius; D3DXMATRIX matRotateX; D3DXMATRIX matRotateY; public: D3DXVECTOR3 position; Particle(); void reset(); void render_particle(); D3DXMATRIX set_particle(float camx, float camy, float camz); void run_particle(float seconds); bool isDead(); }; Particle :: Particle(){ reset(); } void Particle :: reset(){ position = D3DXVECTOR3(random(0.5f), 0.0, random(0.5f)); velocity = D3DXVECTOR3(random(0.5f), random(1.0f, false)+0.5f, random(0.5f)); acceleration = D3DXVECTOR3(0.0f, 0.0f, 0.0f); radius = random(0.5f, false)+0.5f; } bool Particle :: isDead(){ return radius <= 0.0f; } // this is the function that positions, rotates, scales and renders the particle D3DXMATRIX Particle::set_particle(float camx, float camy, float camz) { // Before setting the world transform, do the intense mathematics! // a. Calculate the Differences static float difx, dify, difz; difx = camx - position.x; dify = camy - position.y; difz = camz - position.z; // ooh, intense! // b. Calculate the Distances static float FlatDist, TotalDist; FlatDist = sqrt(difx * difx + difz * difz); TotalDist = sqrt(FlatDist * FlatDist + dify * dify); // c. Y Rotation D3DXMatrixIdentity(&matRotateY); matRotateY._11 = matRotateY._33 = difz / FlatDist; // cosY matRotateY._31 = difx / FlatDist; // sinY matRotateY._13 = -matRotateY._31; // -sinY // d. X Rotation D3DXMatrixIdentity(&matRotateX); matRotateX._22 = matRotateX._33 = FlatDist / TotalDist; // cosX matRotateX._32 = dify / TotalDist; // sinX matRotateX._23 = -matRotateX._32; // -sinX // e. Tranlation static D3DXMATRIX matTranslate; D3DXMatrixTranslation(&matTranslate, position.x, position.y, position.z); // f. Scaling static D3DXMATRIX matScale; D3DXMatrixIdentity(&matScale); matScale._11 = matScale._22 = matScale._33 = radius; return matScale * matRotateX * matRotateY * matTranslate; } // this function updates the particle void Particle::run_particle(float seconds) { velocity += acceleration * seconds; position += velocity * seconds; radius -= seconds; return; }[/source]