Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
0 registered members (), 18,508 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
please give a blood particles code made in lite C #250065
02/05/09 19:54
02/05/09 19:54
Joined: Jan 2009
Posts: 33
Philippines, Quezon City
K
Kaizen_31 Offline OP
Newbie
Kaizen_31  Offline OP
Newbie
K

Joined: Jan 2009
Posts: 33
Philippines, Quezon City
please give me a blood particles code made in lite C because i really need for my game development project..

please give me some codes...

Re: please give a blood particles code made in lite C [Re: Kaizen_31] #250069
02/05/09 19:58
02/05/09 19:58
Joined: Jan 2005
Posts: 605
Deutschland, NRW
G
garv3 Offline
User
garv3  Offline
User
G

Joined: Jan 2005
Posts: 605
Deutschland, NRW
Well, this is not the way to learn creating games.
You should try to learn a bit about particles and try it on your own first.

If you notice problems, when doing it your self, someone will definitely help you to fix them. Another thing you can do is to search the AUMs for some code that fits.


GameStudio Version: A7 Pro v7.86
Re: please give a blood particles code made in lite C [Re: garv3] #250072
02/05/09 20:01
02/05/09 20:01
Joined: Jan 2009
Posts: 33
Philippines, Quezon City
K
Kaizen_31 Offline OP
Newbie
Kaizen_31  Offline OP
Newbie
K

Joined: Jan 2009
Posts: 33
Philippines, Quezon City
please help me i will present this project on Saturday morning so please help me

Re: please give a blood particles code made in lite C [Re: Kaizen_31] #250074
02/05/09 20:06
02/05/09 20:06
Joined: Jan 2005
Posts: 605
Deutschland, NRW
G
garv3 Offline
User
garv3  Offline
User
G

Joined: Jan 2005
Posts: 605
Deutschland, NRW
So what should your effect look like? Unless we know this, nobody will be able to help you. Unfortunately I'm at work and for that have no time to write down some code. But if you tell us more details, someone will help you. Of that I'm sure.


GameStudio Version: A7 Pro v7.86
Re: please give a blood particles code made in lite C [Re: garv3] #250237
02/06/09 19:12
02/06/09 19:12
Joined: Jan 2009
Posts: 33
Philippines, Quezon City
K
Kaizen_31 Offline OP
Newbie
Kaizen_31  Offline OP
Newbie
K

Joined: Jan 2009
Posts: 33
Philippines, Quezon City
when the player hit the enemy some blood particles must go..
and when the enemy was dead some particles should came out in the enemy's body
please give a code please

Re: please give a blood particles code made in lite C [Re: Kaizen_31] #250267
02/06/09 23:39
02/06/09 23:39
Joined: Jan 2005
Posts: 605
Deutschland, NRW
G
garv3 Offline
User
garv3  Offline
User
G

Joined: Jan 2005
Posts: 605
Deutschland, NRW
OK. So what you want are some particles "sparkling" out of the body.

The first thing you need is a sprite that you want to use fore the particle. This should be a red dot image (best .tga) with an alpha-channel for transparency. An example for the define:
Code:
BMAP* blood_particle_bmap = "red_dot.tga";
You need to create this image using a program like photoshop or any other tool supporting alpha channels.

The next thing is an event function for your particle, that defines how the particle (each blood drop) should behave. This might be something like:
Code:
function blooddrop_partikel_function(PARTICLE *p)
{
   p.alpha -= 2*time_step;
   if (p.alpha <= 0) p.lifespan = 0;
}
This tells the drop to become more and more transparent each frame and to disappear when it is completely invisible. You may play with the factor "2" to change the speed of becoming more and more transparent.

Finally you need a function for the effect it's self.
Code:
function blooddrop_effect(PARTICLE *p)
{
   p.size = 4;
   p.alpha = 100;
   p.gravity = 2;
   p.bmap = lblood_particle_bmap;
   p.vel_x = random(10)-5;
   p.vel_y = random(10)-5;
   p.vel_z = random(5)+5;
   p.flags |= MOVE;
   p.event = blooddrop_partikel_function;
}
p.size is the size of each blood drop.
p.alpha is it's transparency right after it's creation. 100 == not transparent at all, 0 == not visible (completely transparent)
p.gravity is the influance of gravity that pulls the particle to the ground.
p.bmap is the image defined before.
p.vel_x ist it's speed on the x-axis.
p.vel_y ist it's speed on the y-axis.
p.vel_z ist it's speed on the z-axis.
p.flags |= MOVE; tells the particle to move according to the p._vel speeds.
p.event is the event function defined above.

This effect function has to be called when the blood is meant to splash out of the body. Probably when the character is hit by a weapon or shot.
Code:
effect_local(blooddrop_effect, 10, startvector, nullvector);

effect_local tells the engine to create a local effect. If you need the effect for a multiplayer game and it shoud be visible on all client, use effect(...) instead.
blooddrop_effect is the effect_function defined before.
10 is the number of particles (blood drops) that you want to create.
startvector has to be the position-vector, where the particles are meant to sparcle out of the body. Probably set by a trace or something like that.
Nullvector is the starting movement direction. You can just use the nullvector because you define the move directions and speed by the p.vel parameters.

Hope, this does help you out. So let me know, if it works!

derGarv


GameStudio Version: A7 Pro v7.86
Re: please give a blood particles code made in lite C [Re: garv3] #250303
02/07/09 08:45
02/07/09 08:45
Joined: Apr 2006
Posts: 624
DEEP 13
badapple Offline
User
badapple  Offline
User

Joined: Apr 2006
Posts: 624
DEEP 13
the gimp also supports alpha channels and is free

Re: please give a blood particles code made in lite C [Re: badapple] #250332
02/07/09 12:51
02/07/09 12:51
Joined: Jan 2009
Posts: 33
Philippines, Quezon City
K
Kaizen_31 Offline OP
Newbie
Kaizen_31  Offline OP
Newbie
K

Joined: Jan 2009
Posts: 33
Philippines, Quezon City
okie thanks guys i try this kind of code that you've gave to me.. thanks alot..

by the way i need a code that can save a game and load it when the player want to load the game..

Re: please give a blood particles code made in lite C [Re: Kaizen_31] #250334
02/07/09 12:56
02/07/09 12:56
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Espér Offline
Expert
Espér  Offline
Expert

Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
look in the manual -.-

Code:
game_save("name",1,SV_ALL-SV_INFO); 

saves the game as "name_1.sav"

and

Code:
game_load("name",1); 

loads the file called "name_1.sav"


those basic functions are included in the default.c
just open the script and look how the game save,load,quit..etc.. works..

Last edited by Espér; 02/07/09 12:57.

Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<
Re: please give a blood particles code made in lite C [Re: Espér] #250336
02/07/09 13:03
02/07/09 13:03
Joined: Jan 2009
Posts: 33
Philippines, Quezon City
K
Kaizen_31 Offline OP
Newbie
Kaizen_31  Offline OP
Newbie
K

Joined: Jan 2009
Posts: 33
Philippines, Quezon City
what if when i have a load_game_button how do i can code that through the use of lite C?? i have thi code in my game..

#include<acknex.h>
#include<default.c>

function save_game()
{
result = game_save("game",7,SV_ALL-SV_INFO);
if(result <= 0)
{
error("save error!");
game_save("info",0,SV_INFO+SV_STRINGS+SV_BMAPS);
}
printf("game save");
on_f1 = save_game;
}

void main()
{
on_f1 = save_game;
}


it works but how do i can load it by the using the button load_game??

Page 1 of 2 1 2

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1