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
2 registered members (AndrewAMD, TipmyPip), 13,353 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
changing entities #304627
01/09/10 13:04
01/09/10 13:04
Joined: Dec 2009
Posts: 361
R
rtsgamer706 Offline OP
Senior Member
rtsgamer706  Offline OP
Senior Member
R

Joined: Dec 2009
Posts: 361
Hello I am a programmer who just knows the basics of lite-c.
I am trying to make a simple action game but I need to know how to make it so when my bullet hits
a big asteroid it turns into a smaller asteroid which I can then destroy with another bullet.
Please help,
rtsgamer

Re: changing entities [Re: rtsgamer706] #304633
01/09/10 13:42
01/09/10 13:42
Joined: Mar 2009
Posts: 40
DR_Black Offline
Newbie
DR_Black  Offline
Newbie

Joined: Mar 2009
Posts: 40
Use ent_morph function or animate your asteroid model


every body got some dues in life to pay
Re: changing entities [Re: DR_Black] #304639
01/09/10 14:42
01/09/10 14:42
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
i would try this:
Code:
function asteriod_event();

function asteriod()
{
	my.emask |= ENABLE_SHOOT;
	my.event = asteriod_event;
	VECTOR vel;
	vec_set(vel,vector(random(2)-1,random(2)-1,random(2)-1));
	VECTOR temp;
	while(me)
	{
		vec_set(temp,vel);
		vec_normalize(temp,5 * time_step);
		vec_add(my.x,temp);
		wait(1);
	}
}

function asteriod_event()
{
	if(event_type == EVENT_SHOOT)
	{
		ent_create("small_asteroid.mdl",my.x,asteroid);
		ent_create("small_asteroid.mdl",my.x,asteroid);
		ent_create("small_asteroid.mdl",my.x,asteroid);
		ent_remove(me);
	}
}



This code will create three asteroids, if the asteroid will be hit.

Last edited by Richi007; 01/09/10 14:43.

Visit my site: www.masterq32.de
Re: changing entities [Re: DR_Black] #304676
01/09/10 21:15
01/09/10 21:15
Joined: Dec 2009
Posts: 361
R
rtsgamer706 Offline OP
Senior Member
rtsgamer706  Offline OP
Senior Member
R

Joined: Dec 2009
Posts: 361
getting closer but when my laser (bullet) hits the asteroid it says can't open file.
Here is the relevant part of my code:

function remove_asteroid()
{
var boom_percent = 0;
if(event_type == EVENT_IMPACT)
{
wait (1);
ent_remove(me);
ent_remove(laser);
}
}

action asteroid()
{
ent_create("laser.mdl", vector (26000, 0, 0), laser_fire);
rock = me;
while (1)
{
c_move (my, vector(-25*time_step, 0, 0), nullvector, GLIDE); // move the fragment left
wait (1);
my.emask = (ENABLE_IMPACT); // make entity sensitive for block and entity collision
my.event = remove_asteroid;
}
}

function remove_asteroidbig ()
{
ent_morph (my, rock);
}

action asteroid_big()
{
boulder = me;
while (1)
{
c_move (my, vector(-28*time_step, 0, 0), nullvector, GLIDE); // move the fragment left
wait (1);
my.emask = (ENABLE_IMPACT); // make entity sensitive for block and entity collision
my.event = remove_asteroidbig;
}
}

thanks for the help

Re: changing entities [Re: rtsgamer706] #304678
01/09/10 21:35
01/09/10 21:35
Joined: Mar 2009
Posts: 40
DR_Black Offline
Newbie
DR_Black  Offline
Newbie

Joined: Mar 2009
Posts: 40
Try this
Code:
var IsAsteriodBig = 1;
function remove_asteroid ();
action asteroid()
{
	ent_create("laser.mdl", vector (26000, 0, 0), laser_fire);
	while (1)
	{
		c_move (my, vector(-25*time_step, 0, 0), nullvector, GLIDE); // move the fragment left
		wait (1);
		my.emask = (ENABLE_IMPACT); // make entity sensitive for block and entity collision
		my.event = remove_asteroid;
	}
}

function remove_asteroid ()
{
	if(event_type == EVENT_IMPACT)
	{
		if (IsAsteriodBig)
		{
			ent_morph (me, "asteroidlittle.mdl");
		}
		else
		{
			wait (1);
			ent_remove(me);
			ent_remove(laser);
		}
		
	}
}



I didnt test it.I think it will work.


every body got some dues in life to pay

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