|
|
#1 |
|
Member
![]() Join Date: Jan 2011
Location: Canada
Posts: 693
Likes: 337
Liked 346 Times in 191 Posts
Mentioned: 10 Post(s)
Tagged: 0 Thread(s)
|
[Released] They Do Not Die v0.5 - ThatOtherDev
ThatOtherDev, known for many entertaining homebrew games has just updated his popular game They Do ... [Read More]
|
|
|
|
|
Likes: (1) |
|
|
#2 |
|
Lord Loren Soth
![]() Join Date: Jan 2011
Location: Dargaard Keep
Posts: 2,088
Likes: 1,924
Liked 1,171 Times in 654 Posts
Mentioned: 39 Post(s)
Tagged: 0 Thread(s)
|
moved to front page!
__________________
|
|
|
|
|
|
#3 |
|
Member
![]() Join Date: Jan 2011
Posts: 78
Likes: 0
Liked 23 Times in 14 Posts
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
|
Hmm well in psuedo code i would do the fade away thing like this.
Struct Blood { vector4 bloodColorTrans = 0.0f,0.0f,0.0f,0.0f Int DespawnCounter = 5 //And any other information you might need ect, like coordinates, size, ect //and a sturct constructor. } Blood bloodSprite = new Blood("path/to/sprite") //plus other consturct args List<Blood> bloodList = new list<Blood>() GameTime counter = GameTime.getSecond() If(Bullet.Collision) bloodList.Add(bloodSprite) Foreach(blood in bloodList) { Draw(blood) } If (counter % 2.0f == 0) // { If (!bloodList == null) Foreach(blood in bloodList) { If(blood.Counter > 0) { blood.BloodColorTrans = BloodColorTrans - vector4(0f,0f,0f,.2f); blood.DespawnCounter - 1; } Else blood.delete(); } } This is just a roughdraft of how i would start. (in C# hehe. )************* [ - Post Merged - ] ************* Perhaps people should add on to what i put? |
|
|
|
|
|
#4 |
|
Homebrew Developer
![]() Join Date: Jun 2009
Posts: 66
Likes: 0
Liked 65 Times in 20 Posts
Mentioned: 3 Post(s)
Tagged: 0 Thread(s)
|
I have no problem with deciding when and where to place blood or their alpha value. I already have that implemented and it is working pretty well in a build that I have running on Windows using OpenGL for rendering (before anyone asks yeah I'll be releasing Windows versions eventually).
![]() My problem comes when I get to that "Draw(blood)" part you mentioned. This is what I've got now. It is imperfect when fewer then the maximum number of decals are in existence but whatever I'm content with it, it doesn't take long for 500 blood or corpse sprites to be spawned and I can improve upon it later. Code:
#ifdef WIN
glBindTexture(GL_TEXTURE_2D,persontexture);
#endif
#ifdef PS3
usetexture(persontexture_image);
#endif
for(int a=0;a<decalcount;a++){
#ifdef WIN
glColor4f(1.f,1.f,1.f,(float)a/(float)maxdecalcount);
#endif
draw2dquad(
decallist[a].posx,
decallist[a].posy,
0.75f,0.75f,
decaltexturecoords[decallist[a].type],
1,decallist[a].angle);
}
#ifdef WIN
glColor4f(1.f,1.f,1.f,1.f);
#endif
Code:
void draw2dquad(float posx,float posy,float sizex,float sizey,float *texturecoords,bool centerandrotate,float angle){
#ifdef PS3
if(centerandrotate==0){
float verts[]={
posx, posy+sizey,
posx+sizex, posy+sizey,
posx+sizex, posy,
posx, posy,};
realityVertexBegin(context,REALITY_QUADS);{
for(int b=0;b<4;b++){
realityTexCoord2f(context,texturecoords[b*2],texturecoords[b*2+1]);
realityVertex4f(context,verts[b*2],verts[b*2+1],0.0,1.0);
}
}
realityVertexEnd(context);
}else if(angle==0){
sizex*=0.5f;
sizey*=0.5f;
float verts[]={
posx-sizex, posy+sizey,
posx+sizex, posy+sizey,
posx+sizex, posy-sizey,
posx-sizex, posy-sizey,};
realityVertexBegin(context,REALITY_QUADS);{
for(int b=0;b<4;b++){
realityTexCoord2f(context,texturecoords[b*2],texturecoords[b*2+1]);
realityVertex4f(context,verts[b*2],verts[b*2+1],0.0,1.0);
}
}
realityVertexEnd(context);
}else{
angle*=-1;
sizex*=0.5f;
sizey*=0.5f;
float vertsunrotated[]={
0-sizex, 0+sizey,
0+sizex, 0+sizey,
0+sizex, 0-sizey,
0-sizex, 0-sizey,};
float verts[]={
posx+vertsunrotated[1]*sin(angle)+vertsunrotated[0]*cos(angle), posy+vertsunrotated[1]*cos(angle)-vertsunrotated[0]*sin(angle),
posx+vertsunrotated[3]*sin(angle)+vertsunrotated[2]*cos(angle), posy+vertsunrotated[3]*cos(angle)-vertsunrotated[2]*sin(angle),
posx+vertsunrotated[5]*sin(angle)+vertsunrotated[4]*cos(angle), posy+vertsunrotated[5]*cos(angle)-vertsunrotated[4]*sin(angle),
posx+vertsunrotated[7]*sin(angle)+vertsunrotated[6]*cos(angle), posy+vertsunrotated[7]*cos(angle)-vertsunrotated[6]*sin(angle),};
realityVertexBegin(context,REALITY_QUADS);{
for(int b=0;b<4;b++){
realityTexCoord2f(context,texturecoords[b*2],texturecoords[b*2+1]);
realityVertex4f(context,verts[b*2],verts[b*2+1],0.0,1.0);
}
}
realityVertexEnd(context);
}
#endif
}
__________________
Last edited by ThatOtherPerson; 09-20-2011 at 02:43 AM. |
|
|
|
|
Likes: (2) |
|
|
#5 |
|
Member
![]() Join Date: Jan 2011
Posts: 78
Likes: 0
Liked 23 Times in 14 Posts
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
|
void realityDrawVertexBuffer(gcmContextData *context, uint32_t type, uint32_t start, uint32_t count);
************* [ - Post Merged - ] ************* Let me see if i can find what your looking for regarding the glcolor4. |
|
|
|
|
|
#6 |
|
Member
![]() Join Date: May 2011
Location: UK
Posts: 743
Likes: 114
Liked 173 Times in 108 Posts
Mentioned: 24 Post(s)
Tagged: 0 Thread(s)
|
I love this game
thanks for the update.
__________________
![]() Ps3 3.55WT, 1TB HDD, Find me on twitter@daveyp187 |
|
|
|
|
|
#7 |
|
Member
![]() Join Date: Sep 2010
Posts: 299
Likes: 122
Liked 66 Times in 48 Posts
Mentioned: 20 Post(s)
Tagged: 0 Thread(s)
|
Gonna try this one out as soon as I get home from work tomorrow. Seems like an awesome game. Thanks and keep up the good work!!
|
|
|
|
|
|
#8 |
|
Apprentice
![]() Join Date: Sep 2011
Location: us
Posts: 10
Likes: 0
Liked 0 Times in 0 Posts
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
|
this would be a cool game.
some one showed make like a postal game. but a lot cooler. and more blood-yer
.
|
|
|
|
|
|
#9 | |
|
Member
![]() Join Date: Feb 2011
Posts: 268
Likes: 55
Liked 38 Times in 31 Posts
Mentioned: 4 Post(s)
Tagged: 0 Thread(s)
|
************* [ - Post Merged - ] ************* I just wish it had some music/sound effects
__________________
Fat 3.55 cobra nfw 500 gb
Slim 4.0 ofw 320 gb |
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
|
|