Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (ozgur, degenerate_762, 7th_zorro), 1,075 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Explosion in mouse coordinated #209970
06/06/08 23:14
06/06/08 23:14
Joined: Apr 2006
Posts: 10
Brasil
alves Offline OP
Newbie
alves  Offline OP
Newbie

Joined: Apr 2006
Posts: 10
Brasil
Simple explosion, on top of the click.

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

SOUND* Explosion_wav = "Explosion.wav";
BMAP* Fire_tga = "Fire.tga";

function VecRandomize(var *vec, var range);
function FadeParticle(PARTICLE *p);
function Fire(PARTICLE *p);
function Explosion();

VECTOR ParticlePos;

/* Main Function
---------------------------------*/
function main()
{
	mouse_mode = 2;
	level_load("Explosao.wmb");
	wait(2);
	while(1)
	{
		on_mouse_left = Explosion;
		vec_set(mouse_pos, mouse_cursor);
		vec_set(ParticlePos, mouse_pos);
		wait(1);
	}
}

function Explosion()
{
	ParticlePos.z = 200;
	snd_play(Explosion_wav, 100, 1);
	vec_for_screen(ParticlePos, camera);
	effect(Fire, 1000, ParticlePos, normal);
}


/* Particle Generator
-------------------------------*/
function Fire(PARTICLE *p)
{
	var temp[3];
	VecRandomize(temp, 10);
	vec_add(p.vel_x, temp);
	p.alpha = 25 + random(25);
	p.bmap = Fire_tga;
	p.flags |= (BRIGHT | MOVE);
	p.event = FadeParticle;
}


/* Dist and Direction of particle
---------------------------------------------------------*/
function VecRandomize(var *vec, var range)
{
	vec[0] = random(1) - 0.5;
	vec[1] = random(1) - 0.5;
	vec[2] = random(1) - 0.5;
	vec_normalize(vec, random(range));
}


/* Particle life
-------------------------------*/
function FadeParticle(PARTICLE *p)
{
	p.alpha -= 2 * time_step;
	if(p.alpha <= 0)p.lifespan = 0;
}


Executavel


Breve Meu E-BOOK
Desenvolvimento de Jogos Em Lite-C
Iniciante em 3D Game Studio
Meu Portfólio
Re: Explosion in mouse coordinated [Re: alves] #210075
06/07/08 18:12
06/07/08 18:12
Joined: Mar 2006
Posts: 1,993
Karlsruhe
PadMalcom Offline
Serious User
PadMalcom  Offline
Serious User

Joined: Mar 2006
Posts: 1,993
Karlsruhe
Nice one, could not stop clicking for about 2 Minutes :P

Re: Explosion in mouse coordinated [Re: PadMalcom] #210080
06/07/08 19:01
06/07/08 19:01
Joined: Apr 2006
Posts: 10
Brasil
alves Offline OP
Newbie
alves  Offline OP
Newbie

Joined: Apr 2006
Posts: 10
Brasil
Change the "on_mouse_left = Explosion," in main function for:

Code:
if(mouse_left == ON)
{
   Explosion();
   wait(-2);
}



In the "wait ()", you set the waiting time.

Last edited by alves; 06/07/08 19:02.

Breve Meu E-BOOK
Desenvolvimento de Jogos Em Lite-C
Iniciante em 3D Game Studio
Meu Portfólio
Re: Explosion in mouse coordinated [Re: alves] #210167
06/08/08 15:17
06/08/08 15:17
Joined: Apr 2007
Posts: 582
Germany
Poison Offline
User
Poison  Offline
User

Joined: Apr 2007
Posts: 582
Germany
wow, looks awesome.
Thank you alves.


Everything is possible, just Do it!
Re: Explosion in mouse coordinated [Re: Poison] #210557
06/11/08 14:19
06/11/08 14:19
Joined: Aug 2002
Posts: 673
Las Cruces, NM
JimFox Offline
User
JimFox  Offline
User

Joined: Aug 2002
Posts: 673
Las Cruces, NM
Hi,
I usually groan when I see "rapidshare" as the file location. But this time it downloaded very easily. No problem.
Thanks for a nice little effect!!
Best regards,


Jim
Re: Explosion in mouse coordinated [Re: JimFox] #212992
06/25/08 09:52
06/25/08 09:52
Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
VeT Offline

Serious User
VeT  Offline

Serious User

Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
he-he, i also couldnt stop clicking for some minutes)))


1st prize: Lite-C and Newton 2.17 by Vasilenko Vitaliy

Newton2 videos: http://tinyurl.com/NewtonVideos
LiteC+Newton2 discussion: http://tinyurl.com/NewtonWrapperDiscussion
Latest LiteC+Newton2 version(v23, from 29.10.2009): http://depositfiles.com/files/ae1l0tpro

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

Gamestudio download | chip programmers | 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