Chlorodatafile Utilisateur confirmé: Rang *****
Messages : 2929 Localisation : Belfort Projet Actuel :
Paralights
| Sujet: [Script] Horloge Lun 26 Jan 2009 - 19:11 | |
| Bonjour, j'ai conçu, avec morgan et l'assistance FJMC (les info sur les radian) 8 script, et un exemple, oui ça arrive :gniah: Ces script permettent de faire facilement une horloge.horloge_create : - Spoiler:
- Code:
-
// horloge_create(taille,forme 0 1 2,vitesse,sec,min,H) h_speed=argument2 alarm[0]=h_speed choix_horlogeforme=argument1 secrot = argument3 minrot = argument4 heurot = argument5 point_ure = pi/6 h_h=argument0
horloge_color_init : - Spoiler:
- Code:
-
// horloge_color_init(cadre color,cadre interne color,cadre externe color,aiguille seconde,aiguille minute,aiguille heure) c_cadre = argument0 c_cadint = argument1 c_cadext = argument2 c_aigsec = argument3 c_aigmin = argument4 c_aigheu = argument5
horloge_alarm0 : - Spoiler:
- Code:
-
alarm[0]=h_speed if choix_horlogeforme=1 { secrot -= 2*pi/60 minrot -= 2*pi/3600 heurot -= 2*pi/(3600*12) } if choix_horlogeforme=0 { secrot -= 360/60 minrot -= 360/3600 heurot -= 360/(3600*12) } if choix_horlogeforme=2 { secrot += 1 if secrot=60 {secrot=0 minrot+=1} if minrot=60 {minrot=0 heurot+=1} if heurot=24 {heurot=0} }
horloge_draw : - Spoiler:
- Code:
-
if choix_horlogeforme=2 { draw_set_color(c_cadint) draw_rectangle(x+1,y+1,x+argument3-1,y+h_h-1,true) draw_set_color(c_cadext) draw_rectangle(x+2,y+2,x+argument3-2,y+h_h-2,false) draw_set_color(c_cadre) draw_rectangle(x,y,x+argument3,y+h_h,true) draw_text(x+3,y+3,string(heurot)) draw_text(x+3+h_h,y+3,":"+string(minrot)) draw_text(x+3+h_h*2,y+3," ::"+string(secrot)) } if choix_horlogeforme=0 { draw_sprite(sprite_index,0,x,y) draw_sprite_ext(argument0,1,x,y,1,1,secrot,image_blend,image_alpha) draw_sprite_ext(argument1,1,x,y,1,1,minrot,image_blend,image_alpha) draw_sprite_ext(argument2,1,x,y,1,1,heurot,image_blend,image_alpha) if secrot=360 {secrot=0} if minrot=360 {minrot=0} if heurot=360 {heurot=0} } if choix_horlogeforme=1 { draw_set_color(c_cadext) draw_circle(x,y,h_h,false) draw_set_color(c_cadint) draw_circle(x,y,h_h-(h_h/12),false) draw_set_color(c_aigsec) draw_line(x,y,x+argument3*cos(-secrot),y+argument3*sin(-secrot)) draw_set_color(c_aigmin) draw_line(x,y,x+argument4*cos(-minrot),y+argument4*sin(-minrot)) draw_set_color(c_aigheu) draw_line(x,y,x+argument5*cos(-heurot),y+argument5*sin(-heurot)) draw_set_color(c_cadre) draw_circle(x,y,h_h,true) draw_circle(x,y,h_h-(h_h/12),true) draw_rectangle(x+((h_h-(h_h/7))*cos(-point_ure)),y+((h_h-(h_h/7))*sin(-point_ure)),x+((h_h-(h_h/7))*cos(-point_ure))+1,y+((h_h-(h_h/7))*sin(-point_ure))+1,false) draw_rectangle(x+((h_h-(h_h/7))*cos(-point_ure*2)),y+((h_h-(h_h/7))*sin(-point_ure*2)),x+((h_h-(h_h/7))*cos(-point_ure*2))+1,y+((h_h-(h_h/7))*sin(-point_ure*2))+1,false) draw_rectangle(x+((h_h-(h_h/7))*cos(-point_ure*3)),y+((h_h-(h_h/7))*sin(-point_ure*3)),x+((h_h-(h_h/7))*cos(-point_ure*3))+1,y+((h_h-(h_h/7))*sin(-point_ure*3))+1,false) draw_rectangle(x+((h_h-(h_h/7))*cos(-point_ure*4)),y+((h_h-(h_h/7))*sin(-point_ure*4)),x+((h_h-(h_h/7))*cos(-point_ure*4))+1,y+((h_h-(h_h/7))*sin(-point_ure*4))+1,false) draw_rectangle(x+((h_h-(h_h/7))*cos(-point_ure*5)),y+((h_h-(h_h/7))*sin(-point_ure*5)),x+((h_h-(h_h/7))*cos(-point_ure*5))+1,y+((h_h-(h_h/7))*sin(-point_ure*5))+1,false) draw_rectangle(x+((h_h-(h_h/7))*cos(-point_ure*6)),y+((h_h-(h_h/7))*sin(-point_ure*6)),x+((h_h-(h_h/7))*cos(-point_ure*6))+1,y+((h_h-(h_h/7))*sin(-point_ure*6))+1,false) draw_rectangle(x+((h_h-(h_h/7))*cos(-point_ure*7)),y+((h_h-(h_h/7))*sin(-point_ure*7)),x+((h_h-(h_h/7))*cos(-point_ure*7))+1,y+((h_h-(h_h/7))*sin(-point_ure*7))+1,false) draw_rectangle(x+((h_h-(h_h/7))*cos(-point_ure*8)),y+((h_h-(h_h/7))*sin(-point_ure*8)),x+((h_h-(h_h/7))*cos(-point_ure*8))+1,y+((h_h-(h_h/7))*sin(-point_ure*8))+1,false) draw_rectangle(x+((h_h-(h_h/7))*cos(-point_ure*9)),y+((h_h-(h_h/7))*sin(-point_ure*9)),x+((h_h-(h_h/7))*cos(-point_ure*9))+1,y+((h_h-(h_h/7))*sin(-point_ure*9))+1,false) draw_rectangle(x+((h_h-(h_h/7))*cos(-point_ure*10)),y+((h_h-(h_h/7))*sin(-point_ure*10)),x+((h_h-(h_h/7))*cos(-point_ure*10))+1,y+((h_h-(h_h/7))*sin(-point_ure*10))+1,false) draw_rectangle(x+((h_h-(h_h/7))*cos(-point_ure*11)),y+((h_h-(h_h/7))*sin(-point_ure*11)),x+((h_h-(h_h/7))*cos(-point_ure*11))+1,y+((h_h-(h_h/7))*sin(-point_ure*11))+1,false) draw_rectangle(x+((h_h-(h_h/7))*cos(-point_ure*12)),y+((h_h-(h_h/7))*sin(-point_ure*12)),x+((h_h-(h_h/7))*cos(-point_ure*12))+1,y+((h_h-(h_h/7))*sin(-point_ure*12))+1,false) if secrot=pi*2 {secrot=-pi/2} if minrot=pi*2 {minrot=-pi/2} if heurot=pi*2 {heurot=-pi/2} }
r_heure : - Spoiler:
- Code:
-
// r_heure(x) return ((pi/30)*((12-argument0+3)*5));
r_minsec : - Spoiler:
- Code:
-
// r_minsec(x) return ((pi/30)*(60-argument0+15));
d_heure : - Spoiler:
- Code:
-
// d_heure(x) return ((360/60)*((12-argument0)*5));
d_minsec : - Spoiler:
- Code:
-
// d_minsec(x) return ((360/60)*(60-argument0)); l'exemple vielle v les script vielle v voilà tout
Dernière édition par gosc le Sam 31 Jan 2009 - 14:57, édité 3 fois |
|
jo *Excellent utilisateur*
Messages : 4879 Localisation : CENSURE T_T Projet Actuel : FAC
| Sujet: Re: [Script] Horloge Lun 26 Jan 2009 - 19:25 | |
| et c'est quoi? exactement? _________________ http://viciousslugs.sup.fr/ <- Des imbéciles en action. Venez visiter, on recherche des lecteurs, des auteurs, et ça paye mal. En fait ça paye pas, mais ya moyen de se marrer. |
|
Chlorodatafile Utilisateur confirmé: Rang *****
Messages : 2929 Localisation : Belfort Projet Actuel :
Paralights
| Sujet: Re: [Script] Horloge Lun 26 Jan 2009 - 19:37 | |
| ça permet de drawer une horloge simplement, ou de la composer avec des sprite, elle peut être de toutes tailles, commencer à toutes heures, et pis ça peut servir d'element décoratif dans certains jeux, et aussi r_heure; r_minsec; d_heure; et d_minsec permettent de traduire respectivement, l'heure en radian, les minute et les seconde en radian, l'heure en degrè et les minute et les seconde en degrè, tous ça, compréhensible pour game maker |
|
morgan Utilisateur confirmé: Rang *****
Messages : 1626 Localisation : Montpellier
| Sujet: Re: [Script] Horloge Ven 30 Jan 2009 - 23:21 | |
| merci d'avoir fait la présentation, j'avais la flemme xD _________________ - Spoiler:
|
|