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
4 registered members (NewbieZorro, Grant, TipmyPip, AndrewAMD), 12,885 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 5 of 5 1 2 3 4 5
Re: A 'Old C-Script articles converted to Lite-C section' [Re: dracula] #237669
11/21/08 13:04
11/21/08 13:04
Joined: Oct 2007
Posts: 5,211
İstanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,211
İstanbul, Turkey
oops forgot laugh

add #define fired skill11 to top

Last edited by Quadraxas; 11/21/08 13:04.

3333333333
Re: A 'Old C-Script articles converted to Lite-C section' [Re: Quad] #237674
11/21/08 13:39
11/21/08 13:39
Joined: Apr 2008
Posts: 437
dracula Offline OP
Senior Member
dracula  Offline OP
Senior Member

Joined: Apr 2008
Posts: 437
Thanks.

My last request (for a while) is AUM 61, Moorhuhn (a bird shooting game featuring crow.mdl)

Thank you for your help and time, I am now on a verticle learning curve


Drac.

Last edited by dracula; 11/21/08 18:45.
Re: A 'Old C-Script articles converted to Lite-C section' [Re: dracula] #237746
11/21/08 22:47
11/21/08 22:47
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline
Senior Expert
Pappenheimer  Offline
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Originally Posted By: dracula
'other users' never expressed an interest

AUM 55, 56 & 57 please ??

Drac


Be assured they will! wink And then it is nice when someone can tell them look at the wiki there's a section where are some of the codes of the AUM already transformed to lite-c.

The wiki was once created because this forum always was full of help and free code etc., but it was extremely difficult for beginners to find what they needed.

That's why it is a nice gesture when the person that gets so much help gives something back to the community, as well!

Re: A 'Old C-Script articles converted to Lite-C section' [Re: dracula] #237759
11/22/08 01:31
11/22/08 01:31
Joined: Oct 2007
Posts: 5,211
İstanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,211
İstanbul, Turkey
Originally Posted By: dracula
Thanks.

My last request (for a while) is AUM 61, Moorhuhn (a bird shooting game featuring crow.mdl)

Thank you for your help and time, I am now on a verticle learning curve


Drac.


no change on resources, copy the code , save it as crow.c in to project directory:
Click to reveal..
Code:
////////////////////////////////////////////////////////
var dead_birds = 0;
var shot = 0;
VECTOR bullet_speed;
var bullets = 10; // number of bullets

//////////////////////////////////////////////////////////////

FONT* arial_font = "Arial#14b"; 

//////////////////////////////////////////////////////////////

BMAP* cursor_pcx = "cursor.pcx"; // cursor bitmap 

//////////////////////////////////////////////////////////////

SOUND* beep_sound = "beep.wav";
SOUND* enemyshot_snd = "enemyshot.wav";
SOUND* playershot_snd = "playershot.wav";
SOUND* enemydead_snd = "dead.wav";

//////////////////////////////////////////////////////////////

function move_bullet();
function remove_bullets();
function player_shoots();
function move_crows();
function kill_crows();

//////////////////////////////////////////////////////////////

STRING* moorhuhn_wmb = "moorhuhn.wmb";

STRING* bullet_mdl = "bullet.mdl";
STRING* crow_mdl = "crow.mdl";

///////////////////////////////////////////////////////////////

PANEL* cursor_pan=
{
	bmap = cursor_pcx;
	pos_x = 392; // (800 - 16) / 2
	pos_y = 292; // (600 - 16) / 2
	flags = OVERLAY | VISIBLE;
}

PANEL* info_pan= // displays the bullets and the number of birds that were shot
{
	pos_x = 0;
	pos_y = 0;
	digits = 10, 575, "Health:%.0f", arial_font, 1, 100; // player's health is always 100
	digits = 330, 575, "Bullets:%.0f", arial_font, 1, bullets;
	digits = 660, 575, "Bodies:%.0f", arial_font, 1, dead_birds;
	flags = VISIBLE;
}


////////////////////////////////////////////////////////////////

function main()
{
	video_mode = 7; // 800x600
	video_depth = 32; // 32 bits
	video_screen = 1; // start the game in full screen mode
	vec_zero(bullet_speed);
	level_load (moorhuhn_wmb);
}	

action my_player() // attach this action to the player
{
	player = my; // I'm the player
	set(my,INVISIBLE);// and I'm invisible - who cares?
	camera.x = player.x;
	camera.y = player.y;
	camera.z = player.z; // choose a convenient position for the player to get a good camera
	camera.pan = 90; // initial camera.pan position
	while (1) // as long as the player is alive
	{
		camera.tilt += 10 * mouse_force.y * time_step;
		camera.tilt = clamp (camera.tilt, -30, 30);
		//if (camera.tilt < -25) {camera.tilt += 1;}
		//if (camera.tilt > 25) {camera.tilt -= 1;}
		camera.pan -= 10 * mouse_force.x * time_step; 
		//if (camera.pan < 60) {camera.pan += 1;} // 90 - 30
		//if (camera.pan > 120) {camera.pan -= 1;} // 90 + 30
		camera.pan = clamp (camera.pan, 45, 135);
		if (mouse_left == 1 && bullets > 0 && shot==0)
		{
			player_shoots();
		}
		player.pan = camera.pan; // rotate the player too
		player.tilt = camera.tilt; // not just the camera
		if ((mouse_right == 1) && (bullets == 0)) // right click to reload the gun
		{
			bullets = 10;
			while (mouse_right == 1) {wait (1);}	
		}
		wait (1); 
	}
}

function player_shoots()
{
	shot=1;
	while (mouse_left == 1 && shot==1) {wait (1);}
	snd_play (playershot_snd, 70, 0);
	ent_create (bullet_mdl, player.x, move_bullet);
	bullets -= 1; // you have used a bullet
	shot=0;
}

function move_bullet()
{
	wait (1);
	if (my == NULL) {return;}
	my.emask = ENABLE_BLOCK | ENABLE_ENTITY;
	my.event = remove_bullets;
	set(my,PASSABLE);
	my.pan = you.pan;
	my.tilt = you.tilt;

	my.skill1 = 0;
	bullet_speed.x = 500*time_step;
	bullet_speed.y = 0;
	bullet_speed.z = 0;
	while (my.skill1 < 50)
	{
		if (my == NULL) {return;}
		if (my.skill1 < 0.1)  // don't collide with the creator
		{
			set(my,PASSABLE);
		}
		else	
		{
			reset(my,PASSABLE);
		}
		my.skill1 += 0.1 * time_step;
		c_move (me,bullet_speed, nullvector,GLIDE);
		wait (1);
	}
	ent_remove (my);
}

function remove_bullets()
{
	wait (1);
	ent_remove (my);
}

function generate_birds_startup()
{
	VECTOR temp;
	vec_zero(temp);
	wait (-1); // wait until the level is loaded
	while (1)
	{
		temp.x = -1000;
		temp.y = random (1000);
		temp.z = 100 + random (500);
		ent_create (crow_mdl, temp, move_crows);
		wait (-3); // generate a crow every 3 seconds
	}
}

function move_crows()
{
	my.emask = ENABLE_IMPACT;
	my.event = kill_crows;
	var crow_speed;
	crow_speed = 5 + random(5);
	while ((my.x < 1250) && (my.skill40 == 0))
	{
		my.x += crow_speed * time_step;
		ent_animate (me, "walk", my.skill42, ANM_CYCLE);	
		my.skill42 += 5 * time_step;
		wait (1);
	}
}

function kill_crows()
{
	my.skill40 = 1; // stop the crow
	set(my,INVISIBLE);
	my.emask = ~ENABLE_IMPACT; // can't be shot from now on
	my.event = NULL;
	dead_birds += 1;
	my.skill10 = 0;
	snd_play (enemydead_snd, 70, 0); 
	wait(-.5);
	ent_remove (my);
}


have fun
-Quad.


3333333333
Re: A 'Old C-Script articles converted to Lite-C section' [Re: Quad] #237775
11/22/08 08:34
11/22/08 08:34
Joined: Apr 2008
Posts: 437
dracula Offline OP
Senior Member
dracula  Offline OP
Senior Member

Joined: Apr 2008
Posts: 437
Thank you Quad. Your contribution to this forum is outstanding

Drac.

Re: A 'Old C-Script articles converted to Lite-C section' [Re: dracula] #239518
12/05/08 01:22
12/05/08 01:22
Joined: Aug 2008
Posts: 408
mi usa
sadsack Offline
Senior Member
sadsack  Offline
Senior Member

Joined: Aug 2008
Posts: 408
mi usa
Sylar and Quadraxas I would like to thank you very much for your code. Right of I see the code works in two ways. I see now how you lay out the code.
Thank you
renny


I have A7 Commercial .............. Now I just need to learn how to use it

Page 5 of 5 1 2 3 4 5

Moderated by  George 

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