DraV tutorial 1

Posted By: Vadim647

DraV tutorial 1 - 02/11/09 18:03

Here's the first release of my gfx-related scripts. Everything described, and I included a basic tutorial that shows you the way of doing things thru clock creation tutorial smile

I've done everything to make it simple, understandable, and powerfull in usage.
Download [49kb]
Don't forget to leave your C&C's here, and also ideas for new functions =)
Posted By: Cowabanga

Re: DraV tutorial 1 - 02/11/09 18:27

Wow! Good work! smile
Posted By: dracula

Re: DraV tutorial 1 - 02/11/09 20:16

Great contribution !
Posted By: Pappenheimer

Re: DraV tutorial 1 - 02/11/09 21:20

Very impressing!
It is not only a tutorial, it is a set of functions that you wrote, right?
Posted By: maslone1

Re: DraV tutorial 1 - 02/12/09 06:49

Thanx! Very nice contribution!
Posted By: Jaxas

Re: DraV tutorial 1 - 02/12/09 09:44

Realy,nice work wink
Posted By: Jaxas

Re: DraV tutorial 1 - 02/12/09 10:06

That's what i waiting for! Realy,nice work wink
Posted By: Vadim647

Re: DraV tutorial 1 - 02/12/09 17:46

@Everyone : Thanks!
@Pappenheimer: yeah, it's set of function I'm developing now smile
Btw, here's the 'first game' using it's functionality:
Click to reveal..
First DraV game. Be sure to place into folder with drav_functions.c
Code:
#include <acknex.h>
#include <default.c>
//Includes
#include "drav_functions.c"
var i;
VECTOR t_vec,t_vec2;
VECTOR color1,color2,color3;

function drav_unit0()
{
	drav_set_color(color2);
	drav_triangle(vector(0,5,0),vector(0,-5,0),vector(-my.skill1*2,0,0));
	drav_triangle(vector(0,6,0),vector(0,-6,0),vector(-my.skill1*2-1,0,0));
	drav_set_color(color1);
	drav_4point(vector(0,8,0),vector(16,3,0),vector(16,-3,0),vector(0,-8,0));
	drav_triangle(vector(2,4,0),vector(2,-4,0),vector(10,0,0));
}

function follower()
{
	my.skill1 = 0;
	my.skill3 = 45;
	while (1)
	{
		my.skill2 = vec_dist(my.x,mouse_pos.x);
		vec_set(t_vec,mouse_pos.x);
		vec_sub(t_vec,my.x);
		vec_to_angle(t_vec2,t_vec);
		if (my.skill2 > 8) my.skill3 = t_vec2.x;
		if (my.skill2 > 32)
		{
			my.skill1 = minv(my.skill1+0.25,4);
		}
		else
		{
			my.skill1 = minv(my.skill1,my.skill2);
			my.skill1 *= 0.85;
			if (my.skill1 < 0.5) my.skill1 = 0;
		}
		vec_set(t_vec,vector(my.skill1,0,0));
		vec_rotate(t_vec,vector(my.skill3,0,0));
		vec_add(my.x,t_vec);
		vec_set(drav_ofs,my.x);
		drav_angle.x = my.skill3;
		drav_unit0();
		wait(1);
	}
}

function star()
{
	my.skill1 = random(360);
	my.skill2 = random(0.6)+0.1;
	my.skill3 = 4 + random(6);
	while (1)
	{
		my.x -= 1;
		my.y += 0.5;
		if (my.x < -10) my.x += 660;
		if (my.y > 490) my.y -= 500;
		drav_angle.x = my.skill1;
		drav_set_alpha(my.skill2);
		drav_set_color(color3);
		vec_set(drav_ofs,my.x);
		drav_circle_ray(nullvector,0,my.skill3,7);
		drav_set_alpha(1);
		wait(1);
	}
}

function main()
{
	fps_max = 60;
	mouse_mode = 4;
	level_load(NULL);
	wait(3);
	draw_textmode("Arial",0,14,100);
	vec_set(color1,vector(0,255,192));
	vec_set(color2,vector(0,192,255));
	vec_set(color3,vector(255,255,255));
	vec_set(sky_color,vector(64,64,64));
	drav_reset();
	drav_set_color(vector(0,255,192));
	for (i=0;i<=100;i+=1) ent_create(NULL,vector(random(640),random(480),0),star);
	ent_create(NULL,vector(32,32,0),follower);
	while(1)
	{
		draw_text("Epic win -> first DraV game :)\nI #define a new way in drawing simplistic graphics",4,4,color1);
		wait(1);
	}
}

Posted By: Gumby22don

Re: DraV tutorial 1 - 03/30/09 21:42

hi - this file doesn't appear to be there anymore - do you have access to a mirror?

Don
have a great day
Posted By: Vadim647

Re: DraV tutorial 1 - 03/31/09 13:02

that's temporary, due to server maintance (it will be avaible tomorrow).
© 2024 lite-C Forums