Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AbrahamR, 1 invisible), 858 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
cursor particles #275850
07/02/09 14:11
07/02/09 14:11
Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
VeT Offline OP

Serious User
VeT  Offline OP

Serious User

Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine


looking like they ignores lifetime... what to do? smile
Code:
///////////////////////////////
#include <acknex.h>
#include <default.c>

BMAP* arrow_pcx = "arrow.pcx";
BMAP* snow_tga = "dampf.tga";
///////////////////////////////

function main()
{
  vec_set(screen_size,vector(800,600,0));
  vec_set(screen_color,vector(50,1,1)); // dark blue
  vec_set(sky_color,vector(50,1,1)); // dark blue
  video_window(NULL,NULL,0,"My New Game");
  d3d_antialias = 1;
  shadow_stencil = 3;
  random_seed(0);

  level_load("level1.wmb");
}

function mouse_startup()
{  
	mouse_mode = 2;
	mouse_map = arrow_pcx;
	while (1)
	{  
		vec_set(mouse_pos, mouse_cursor);
		wait(1);
	}
}

function fade_part(PARTICLE *p)
{
	p.alpha -= 20;
	if (p.alpha < 0) {p.lifespan = 0;}
}

function p_mouse_particles(PARTICLE* p)
{
	/*
	VECTOR particle_direction;
	particle_direction.x = (random(1) - 2)*0.01;
	particle_direction.y = 0; //(random(1) - 2)*0.01;
	particle_direction.z = 0; //0.01 * random(1);
	vec_add(p.vel_x, particle_direction);
	*/
	p.alpha = 30 + random(20);
	p.size = 0.5;
	p.bmap = snow_tga;
	set(p, MOVE | BRIGHT | TRANSLUCENT );
	my.event = fade_part;
}

function particles_startup()
{
	VECTOR particle_origin;
	while (1)
	{
		particle_origin.x = mouse_pos.x;
		particle_origin.y = mouse_pos.y;
		particle_origin.z = 40;
		vec_for_screen (particle_origin, camera);
		effect(p_mouse_particles, 1, particle_origin.x, vector(0,0,1));
		wait (1);
	}
}




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
Re: cursor particles [Re: VeT] #275953
07/02/09 21:03
07/02/09 21:03
Joined: Dec 2008
Posts: 528
Wagga, Australia
the_mehmaster Offline
User
the_mehmaster  Offline
User

Joined: Dec 2008
Posts: 528
Wagga, Australia
what is your alpha threshold?

If it's 50 (default) your code won't work..

set it to 0 or 1:
Quote:
d3d_alpharef
Determines the transparency threshold for overlay textures. Pixels below this threshold are completely transparent. By adjusting this variable, seams around the transparent parts of overlay images can be minimized.

Range:
0..255 (default: 127 = 50%)


Hope this helps..

Re: cursor particles [Re: the_mehmaster] #276019
07/03/09 08:33
07/03/09 08:33
Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
VeT Offline OP

Serious User
VeT  Offline OP

Serious User

Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
No, neither 0, nor 1 changes nothing frown


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
Re: cursor particles [Re: VeT] #276045
07/03/09 10:02
07/03/09 10:02
Joined: Dec 2008
Posts: 528
Wagga, Australia
the_mehmaster Offline
User
the_mehmaster  Offline
User

Joined: Dec 2008
Posts: 528
Wagga, Australia
sorry i can't be of more help..

If you don't get an answer soon, post in the 'ask the developers' forum.

Re: cursor particles [Re: the_mehmaster] #276052
07/03/09 10:13
07/03/09 10:13
Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
VeT Offline OP

Serious User
VeT  Offline OP

Serious User

Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
Code:
#include <acknex.h>
#include <default.c>

BMAP* arrow_pcx = "arrow.pcx";

function mouse_startup()
{  
	mouse_mode = 2;
	mouse_map = arrow_pcx;

	while (1)
	{  
		vec_set(mouse_pos, mouse_cursor);
		wait(1);
	}
}

function vec_randomize (VECTOR* vec, var range)
{
	vec_set(vec,vector(random(1)-0.5,random(1)-0.5,random(1)-0.5));
	vec_normalize(vec,random(range));
}

// helper function: fades out a particle
function p_alphafade(PARTICLE *p)
{
	p.alpha -= 20*time_step;
	if (p.alpha <= 0) p.lifespan = 0;
}

function p_fountain(PARTICLE* p)
{
	VECTOR vTemp;
	vec_randomize(vTemp,0.5);
	vec_add(p.vel_x,vTemp);
	vec_set(p.blue,vector(255,255,255));
	set(p, MOVE | TRANSLUCENT);
	p.alpha = 100;
	p.size = 0.75;
	p.gravity = 0.1;
	p.event = p_alphafade;
}

function main()
{
	level_load(NULL);
	video_window(NULL,NULL,112,"Particle demo");
	vec_set(camera.x,vector(-150,0,50));
	vec_set(sky_color,vector(50,0,0)); // dark blue


		
			VECTOR particle_origin;
	while (1)
	{
		particle_origin.x = mouse_pos.x;
		particle_origin.y = mouse_pos.y;
		particle_origin.z = 40;
		vec_for_screen (particle_origin, camera);
		
	//	effect(p_mouse_particles, 1, particle_origin.x, vector(0,0,0.1));
		effect(p_fountain,minv(1,40*time_step),particle_origin.x,vector(0,0,2));
		wait (1);
	}
	
	//	effect(p_fountain,minv(1,40*time_step),vector(0,0,0),vector(0,0,2));
		
}



i got what i wanted, thanks smile


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
Re: cursor particles [Re: VeT] #276819
07/06/09 16:07
07/06/09 16:07
Joined: Jun 2006
Posts: 2,640
Earth
Germanunkol Offline
Expert
Germanunkol  Offline
Expert

Joined: Jun 2006
Posts: 2,640
Earth
Yeah. Always multiply with time_step...
So was that the problem?


~"I never let school interfere with my education"~
-Mark Twain
Re: cursor particles [Re: Germanunkol] #276823
07/06/09 16:42
07/06/09 16:42
Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
VeT Offline OP

Serious User
VeT  Offline OP

Serious User

Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
I dont know, i just get another working code.. Try the first one and you'll see smile


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