Marc
Nombre de messages : 2466 Age : 63 Localisation : TOURS (37) Date d'inscription : 17/03/2014
| Sujet: Qui fait quoi ? Lun 16 Juil 2018 - 12:57 | |
| Bonjour à tous ! Voici un exemple d'application de la Roue à n faces que vous trouverez >> ici <<C'est un distributeur de tâches ménagères - Code:
-
' ------------------------------------------------------------------------------ ' PANORAMIC Distributeur de tâches ménagères / 3D housework ' Marc - July 2018 - Panoramic v.0.9.28 ' http://panoramic-language.pagesperso-orange.fr/French/index.html ' http://panoramic.top-forum.net ' ------------------------------------------------------------------------------ ' main Init() Faces(16) Index() Instructions() CAM_MOVE -45 ON_MOUSE_DOWN 3,Action END ' ------------------------------------------------------------------------------ SUB Init() LABEL Action, Period, Quit DEGREES DIM Nb%,i%,Teta,x,y,z,a$,Alea,c,t HEIGHT 0,500 + HEIGHT(0)-HEIGHT_CLIENT(0) WIDTH 0,500 + WIDTH(0)-WIDTH_CLIENT(0) LEFT 0,(screen_x-WIDTH(0))/2 TOP 0,(screen_y-HEIGHT(0))/2 COLOR 0,0,0,0 ON_CLOSE 0, Quit END_SUB ' ------------------------------------------------------------------------------ SUB Faces(n%) DIM_LOCAL i% Nb%=n% y=0 z=5/tan(360/n%/2) Teta=360/n% SCENE3D 100 HEIGHT 100,500 WIDTH 100,200 COLOR 100,0,0,0 CAM_POSITION 0,0,6 PICTURE 1 WIDTH 1,200 HEIGHT 1,200 2D_TARGET_IS 1 PRINT_TARGET_IS 1 FONT_NAME 1,"Times New Roman" FONT_SIZE 1,28 Face1(1) Face2(2) Face3(3) Face4(4) Face5(5) Face6(6) Face7(7) Face8(8) Face9(9) Face10(10) Face11(11) Face12(12) Face13(13) Face14(14) Face15(15) Face16(16) FOR i%= 1 to Nb% 3D_X_ROTATE i%,y+((i%-1)*Teta) 3D_Y_POSITION i%,z*(SIN(y+((i%-1)*Teta))) 3D_Z_POSITION i%,z*(COS(y+((i%-1)*Teta))) NEXT i% END_SUB ' ------------------------------------------------------------------------------ SUB Offset() x=(200-TEXT_WIDTH(a$,1))/2 END_SUB ' ------------------------------------------------------------------------------ SUB Face1(n%) COLOR 1,0,0,255 2D_FILL_COLOR 0,0,255 FONT_COLOR 1,255,255,255 a$="Vider" Offset() PRINT_LOCATE x,25 PRINT a$ a$="le" Offset() PRINT_LOCATE x,75 PRINT a$ a$="lave-vaisselle" Offset() PRINT_LOCATE x,130 PRINT a$ IMAGE 10 2D_IMAGE_COPY 10,0,0,200,200 3D_PLANE n% 3D_V_TILE n%,1 3D_U_TILE n%,1 3D_IMAGE_TEXTURE n%,10 END_SUB ' ------------------------------------------------------------------------------ SUB Face2(n%) COLOR 1,0,255,0 2D_FILL_COLOR 0,255,0 FONT_COLOR 1,0,0,0 a$="Sortir" Offset() PRINT_LOCATE x,25 PRINT a$ a$="les" Offset() PRINT_LOCATE x,75 PRINT a$ a$="poubelles" Offset() PRINT_LOCATE x,130 PRINT a$ 2D_IMAGE_COPY 10,0,0,200,200 3D_PLANE n% 3D_V_TILE n%,1 3D_U_TILE n%,1 3D_IMAGE_TEXTURE n%,10 END_SUB ' ------------------------------------------------------------------------------ SUB Face3(n%) COLOR 1,0,0,0 2D_FILL_COLOR 0,0,0 FONT_COLOR 1,255,255,255 a$="Laver" Offset() PRINT_LOCATE x,25 PRINT a$ a$="les" Offset() PRINT_LOCATE x,75 PRINT a$ a$="vitres" Offset() PRINT_LOCATE x,130 PRINT a$ 2D_IMAGE_COPY 10,0,0,200,200 3D_PLANE n% 3D_V_TILE n%,1 3D_U_TILE n%,1 3D_IMAGE_TEXTURE n%,10 END_SUB ' ------------------------------------------------------------------------------ SUB Face4(n%) COLOR 1,0,255,255 2D_FILL_COLOR 0,255,255 FONT_COLOR 1,0,0,0 a$="Etendre" Offset() PRINT_LOCATE x,25 PRINT a$ a$="le" Offset() PRINT_LOCATE x,75 PRINT a$ a$="linge" Offset() PRINT_LOCATE x,130 PRINT a$ 2D_IMAGE_COPY 10,0,0,200,200 3D_PLANE n% 3D_V_TILE n%,1 3D_U_TILE n%,1 3D_IMAGE_TEXTURE n%,10 END_SUB ' ------------------------------------------------------------------------------ SUB Face5(n%) COLOR 1,255,0,0 2D_FILL_COLOR 255,0,0 FONT_COLOR 1,0,0,0 a$="Nettoyer" Offset() PRINT_LOCATE x,25 PRINT a$ a$="les" Offset() PRINT_LOCATE x,75 PRINT a$ a$="toilettes" Offset() PRINT_LOCATE x,130 PRINT a$ 2D_IMAGE_COPY 10,0,0,200,200 3D_PLANE n% 3D_V_TILE n%,1 3D_U_TILE n%,1 3D_IMAGE_TEXTURE n%,10 END_SUB ' ------------------------------------------------------------------------------ SUB Face6(n%) COLOR 1,255,0,255 2D_FILL_COLOR 255,0,255 FONT_COLOR 1,0,0,0 a$="Laver" Offset() PRINT_LOCATE x,25 PRINT a$ a$="la" Offset() PRINT_LOCATE x,75 PRINT a$ a$="voiture" Offset() PRINT_LOCATE x,130 PRINT a$ 2D_IMAGE_COPY 10,0,0,200,200 3D_PLANE n% 3D_V_TILE n%,1 3D_U_TILE n%,1 3D_IMAGE_TEXTURE n%,10 END_SUB ' ------------------------------------------------------------------------------ SUB Face7(n%) COLOR 1,255,255,0 2D_FILL_COLOR 255,255,0 FONT_COLOR 1,0,0,0 a$="Arroser" Offset() PRINT_LOCATE x,25 PRINT a$ a$="les" Offset() PRINT_LOCATE x,75 PRINT a$ a$="fleurs" Offset() PRINT_LOCATE x,130 PRINT a$ 2D_IMAGE_COPY 10,0,0,200,200 3D_PLANE n% 3D_V_TILE n%,1 3D_U_TILE n%,1 3D_IMAGE_TEXTURE n%,10 END_SUB ' ------------------------------------------------------------------------------ SUB Face8(n%) COLOR 1,255,255,255 2D_FILL_COLOR 255,255,255 FONT_COLOR 1,0,0,0 a$="Mettre" Offset() PRINT_LOCATE x,25 PRINT a$ a$="la" Offset() PRINT_LOCATE x,75 PRINT a$ a$="table" Offset() PRINT_LOCATE x,130 PRINT a$ 2D_IMAGE_COPY 10,0,0,200,200 3D_PLANE n% 3D_V_TILE n%,1 3D_U_TILE n%,1 3D_IMAGE_TEXTURE n%,10 END_SUB ' ------------------------------------------------------------------------------ SUB Face9(n%) COLOR 1,0,0,255 2D_FILL_COLOR 0,0,255 FONT_COLOR 1,255,255,255 a$="Faire" Offset() PRINT_LOCATE x,25 PRINT a$ a$="le" Offset() PRINT_LOCATE x,75 PRINT a$ a$="lit" Offset() PRINT_LOCATE x,130 PRINT a$ 2D_IMAGE_COPY 10,0,0,200,200 3D_PLANE n% 3D_V_TILE n%,1 3D_U_TILE n%,1 3D_IMAGE_TEXTURE n%,10 END_SUB ' ------------------------------------------------------------------------------ SUB Face10(n%) COLOR 1,0,255,0 2D_FILL_COLOR 0,255,0 FONT_COLOR 1,0,0,0 a$="Repos" Offset() PRINT_LOCATE x,25 PRINT a$ a$="bien" Offset() PRINT_LOCATE x,75 PRINT a$ a$="mérité" Offset() PRINT_LOCATE x,130 PRINT a$ 2D_IMAGE_COPY 10,0,0,200,200 3D_PLANE n% 3D_V_TILE n%,1 3D_U_TILE n%,1 3D_IMAGE_TEXTURE n%,10 END_SUB ' ------------------------------------------------------------------------------ SUB Face11(n%) COLOR 1,0,255,255 2D_FILL_COLOR 0,255,255 FONT_COLOR 1,0,0,0 a$="Passer" Offset() PRINT_LOCATE x,25 PRINT a$ a$="l'aspirateur" Offset() PRINT_LOCATE x,130 PRINT a$ 2D_IMAGE_COPY 10,0,0,200,200 3D_PLANE n% 3D_V_TILE n%,1 3D_U_TILE n%,1 3D_IMAGE_TEXTURE n%,10 END_SUB ' ------------------------------------------------------------------------------ SUB Face12(n%) COLOR 1,20,20,20 2D_FILL_COLOR 20,20,20 FONT_COLOR 1,255,255,255 a$="Faire" Offset() PRINT_LOCATE x,25 PRINT a$ a$="les" Offset() PRINT_LOCATE x,75 PRINT a$ a$="courses" Offset() PRINT_LOCATE x,130 PRINT a$ 2D_IMAGE_COPY 10,0,0,200,200 3D_PLANE n% 3D_V_TILE n%,1 3D_U_TILE n%,1 3D_IMAGE_TEXTURE n%,10 END_SUB ' ------------------------------------------------------------------------------ SUB Face13(n%) COLOR 1,255,0,0 2D_FILL_COLOR 255,0,0 FONT_COLOR 1,0,0,0 a$="Débarrasser" Offset() PRINT_LOCATE x,25 PRINT a$ a$="la" Offset() PRINT_LOCATE x,75 PRINT a$ a$="table" Offset() PRINT_LOCATE x,130 PRINT a$ 2D_IMAGE_COPY 10,0,0,200,200 3D_PLANE n% 3D_V_TILE n%,1 3D_U_TILE n%,1 3D_IMAGE_TEXTURE n%,10 END_SUB ' ------------------------------------------------------------------------------ SUB Face14(n%) COLOR 1,255,255,0 2D_FILL_COLOR 255,255,0 FONT_COLOR 1,0,0,0 a$="Repasser" Offset() PRINT_LOCATE x,25 PRINT a$ a$="le" Offset() PRINT_LOCATE x,75 PRINT a$ a$="linge" Offset() PRINT_LOCATE x,130 PRINT a$ 2D_IMAGE_COPY 10,0,0,200,200 3D_PLANE n% 3D_V_TILE n%,1 3D_U_TILE n%,1 3D_IMAGE_TEXTURE n%,10 END_SUB ' ------------------------------------------------------------------------------ SUB Face15(n%) COLOR 1,255,0,255 2D_FILL_COLOR 255,0,255 FONT_COLOR 1,0,0,0 a$="Faire" Offset() PRINT_LOCATE x,25 PRINT a$ a$="la" Offset() PRINT_LOCATE x,75 PRINT a$ a$="vaisselle" Offset() PRINT_LOCATE x,130 PRINT a$ 2D_IMAGE_COPY 10,0,0,200,200 3D_PLANE n% 3D_V_TILE n%,1 3D_U_TILE n%,1 3D_IMAGE_TEXTURE n%,10 END_SUB ' ------------------------------------------------------------------------------ SUB Face16(n%) COLOR 1,255,255,255 2D_FILL_COLOR 255,255,255 FONT_COLOR 1,0,0,0 a$="Préparer" Offset() PRINT_LOCATE x,25 PRINT a$ a$="le" Offset() PRINT_LOCATE x,75 PRINT a$ a$="repas" Offset() PRINT_LOCATE x,130 PRINT a$ 2D_IMAGE_COPY 10,0,0,200,200 3D_PLANE n% 3D_V_TILE n%,1 3D_U_TILE n%,1 3D_IMAGE_TEXTURE n%,10 END_SUB ' ------------------------------------------------------------------------------ SUB Index() PICTURE 50 HEIGHT 50,40 WIDTH 50,40 COLOR 50,0,0,0 2D_TARGET_IS 50 2D_PEN_COLOR 210,210,210 2D_POLY_FROM 0,20 2D_POLY_TO 39,40 2D_POLY_TO 30,20 2D_POLY_TO 0,20 2D_POLY_TO 40,0 2D_POLY_TO 30,20 2D_FLOOD 20,17,255,255,255 2D_FLOOD 20,23,200,200,200 2D_IMAGE_COPY 10,0,0,40,40 SCENE2D 51 HEIGHT 51,40 WIDTH 51,40 TOP 51,230 LEFT 51,175 SPRITE 1 SPRITE_IMAGE_LOAD 1,10 END_SUB ' ------------------------------------------------------------------------------ SUB Instructions() PICTURE 2 WIDTH 2,250 HEIGHT 2,500 LEFT 2,250 COLOR 2,0,0,0 2D_TARGET_IS 2 PRINT_TARGET_IS 2 2D_FILL_COLOR 0,0,0 FONT_NAME 2,"Times New Roman" FONT_ITALIC 2 FONT_SIZE 2,30 FONT_COLOR 2,255,255,255 PRINT_LOCATE 0,55 PRINT "Qui fait quoi ?" FONT_SIZE 2,20 PRINT_LOCATE 25,180 PRINT "Allez ! Courage !" PRINT_LOCATE 65,230 PRINT "Appuyez" PRINT_LOCATE 30,280 PRINT "sur ce bouton !" 2D_PEN_COLOR 255,255,255 2D_PEN_WIDTH 2 2D_RECTANGLE 112,330,118,359 2D_POLY_FROM 104,350 2D_POLY_TO 114,360 2D_POLY_TO 125,349 PICTURE 3 WIDTH 3,70 HEIGHT 3,70 LEFT 3,330 TOP 3,370 COLOR 3,255,0,0 END_SUB ' ------------------------------------------------------------------------------ Action: OFF_MOUSE_DOWN 3 ON_MOUSE_UP 3, Period c = NUMBER_TICKS RETURN ' ------------------------------------------------------------------------------ Period: OFF_MOUSE_UP 3 alea = NUMBER_TICKS - c + RND(360) IF alea > 5000 alea = 4000 + RND(360) + RND(180) END_IF Animation() ON_MOUSE_DOWN 3,Action RETURN ' ------------------------------------------------------------------------------ SUB Animation() WHILE alea > 5 c=alea/100 FOR i%= 1 to Nb% 3D_X_ROTATE i%,WRAP_VALUE((c+t)*-1)+((i%-1)*Teta) 3D_Y_POSITION i%,z*(SIN(WRAP_VALUE((c+t)*-1)+((i%-1)*Teta))) 3D_Z_POSITION i%,z*(COS(WRAP_VALUE((c+t)*-1)+((i%-1)*Teta))) NEXT i% t=c+t DISPLAY PAUSE 20 alea=alea-c c = c*.95 END_WHILE END_SUB ' ------------------------------------------------------------------------------ Quit: TERMINATE RETURN
Dernière édition par Marc le Lun 13 Aoû 2018 - 18:55, édité 2 fois | |
|