Rame ou rame pas !!?

Vous débutez et vous avez besoin d'aide ? N'hésitez pas à poser vos questions
Avatar de l’utilisateur
SPH
Messages : 4947
Inscription : mer. 09/nov./2005 9:53

Rame ou rame pas !!?

Message par SPH »

est ce que ce code rame chez vous ? Donnez votre OS. Merci

Code : Tout sélectionner

InitSprite() 
InitMouse() 
InitKeyboard() 
;InitSprite3D() 
UseJPEGImageDecoder()

ExamineDesktops()
ddw=DesktopWidth(0)
ddh=DesktopHeight(0)
ddw2=1024
ddh2=768

zoomx.f=(ddw-ddw2)/2
zoomy.f=(ddh-ddh2)/2


OpenScreen(ddw,ddh,32,"SPH Demo") 

StartDrawing(ScreenOutput()) 
Box(0,0,92,128,RGB(150,150,150))
StopDrawing()
GrabSprite(0,0,0,92,128)
StartDrawing(ScreenOutput()) 
Box(0,0,92,384,RGB(150,150,150))
StopDrawing()
GrabSprite(1,0,0,92,384)


Dim points.Point(10) 

f0.f=1
f1.f=0
f2.f=3.14159265/5

la:

Dim craquelure1.b(130)
Dim craquelure2.b(130)
For i=0 To 130
craquelure1(i)=Random(14)-7
craquelure2(i)=Random(14)-7
Next
craquelure.f=1
craquelure_actu.f=0
; debut affichage starscrool

Structure pixel 
posx.f
posy.f
xx.f
yy.f
centrex.l
centrey.l
rayon.f
couleur.l
EndStructure 

NewList pixel.pixel() ; pour pas s'y perdre, vaux mieux donner le meme nom a la structure qu'a la liste

time=0
centrex=ddw2/2
centrey=ddh2/2
angle.f=0
rnd_angle.f=20
rnd_randon=200
vitessex.f=0.02
vitessey.f=0.02
nbb=0

;############
;############
;############
;############
;############
;############

craque=0
craque2=0
presente= 0


Repeat

ExamineKeyboard() 

;ClearScreen(RGB(rvb_cls,rvb_cls,rvb_cls))
;If rvb_cls>0
;rvb_cls-8
;EndIf
ClearScreen(0)


;********************************************
If time<900
For i=1 To 20
    AddElement(pixel())
      pixel()\centrex=centrex
      pixel()\centrey=centrey
      rayon.f=5+Random(500)
      angle=Random(6559)
      x = Cos(angle)*rayon
      y = Sin(angle)*rayon
      pixel()\posx = x
      pixel()\posy = y
      z=Random(100)+20
      pixel()\xx = x/z
      pixel()\yy = y/z
      pixel()\couleur = 130+Random(Random(10000))
Next
EndIf
;********************************************


time+1

If time> 180 And time<200
u=100
StartDrawing(ScreenOutput()) 
For i=craque To 127
LineXY(80+craquelure1(i)+zoomx,ddh-i*8+zoomy,80+craquelure1(i+1)+zoomx,ddh-i*8-8+zoomy,RGB(u,u,u))
u-1
Next
craque+8
StopDrawing()
EndIf

If time> 200 And time<220
u=100
StartDrawing(ScreenOutput()) 
For i=craque2 To 127
LineXY(350+craquelure2(i)+zoomx,ddh-i*8+zoomy,350+craquelure2(i+1)+zoomx,ddh-i*8-8+zoomy,RGB(u,u,u))
u-1
Next
craque2+8
StopDrawing()
EndIf








;############################################################################
;############################################################################
;############################################################################
;############################################################################
;############################################################################
;############################################################################
;############################################################################
;############################################################################
;############################################################################





If time>220

If craquelure_actu<1500
; 
 hdc=StartDrawing(ScreenOutput()) ;*********************** S T A R T
 craquelure_actu=craquelure
 ;LineXY(590,0,100,100,RGB(255,255,255))
; 
 For i=0 To 127
 points(0)\x=80+craquelure1(i)+zoomx
 points(0)\y=ddh-i*8
 points(1)\x=350+craquelure2(i)+zoomx
 points(1)\y=ddh-i*8
 points(2)\x=350+craquelure1(i+1)+zoomx
 points(2)\y=ddh-i*8-8
 points(3)\x=80+craquelure2(i+1)+zoomx
 points(3)\y=ddh-i*8-8
 
 If hdc 
 rvb=craquelure_actu*2
 If rvb>255
 rvb=255
 EndIf
    Box(0,0,0,0,RGB(rvb/5,rvb/5,rvb))
    Polygon_(hdc,points(),4) 
 EndIf 
 craquelure_actu*1.01
 Next
 StopDrawing()
 
 DisplaySprite(0,170+zoomx,70)
 
 hdc=StartDrawing(ScreenOutput()) ;*********************** S T A R T
 craquelure_actu=craquelure
 
 For i=0 To 129
 points(0)\x=72+craquelure1(i)+zoomx-craquelure_actu/2
 points(0)\y=ddh-i*8+craquelure_actu
 points(1)\x=358+craquelure2(i)+zoomx+craquelure_actu/2
 points(1)\y=ddh-i*8+craquelure_actu
 points(2)\x=358+craquelure1(i+1)+zoomx+craquelure_actu/2
 points(2)\y=ddh-i*8-8+craquelure_actu*1.015
 points(3)\x=72+craquelure2(i+1)+zoomx-craquelure_actu/2
 points(3)\y=ddh-i*8-8+craquelure_actu*1.015
 
 rvb=craquelure_actu*2
 If rvb>255
 rvb=255
 EndIf
 If points(1)\y>points(2)\y
 Box(0,0,0,0,RGB(rvb/4,rvb/3,rvb/2))
 Else
 Box(0,0,0,0,RGB(rvb,rvb,rvb))
 EndIf
 If hdc 
 If points(1)\y<1100
    Polygon_(hdc,points(),4) 
 EndIf 
 EndIf 
 craquelure_actu*1.015
 Next
 craquelure*1.025
 StopDrawing()
 
 
 Else ; les polygones bleus qui restent
 
 hdc=StartDrawing(ScreenOutput()) ;*********************** S T A R T
 ;LineXY(590,0,500,100,RGB(255,255,255))
 If presente>560
 If reduc.f=0
 reduc.f=1.1
 EndIf
 For i=0 To 127
 points(0)\x=80+zoomx+craquelure1(i)-reduc/20
 points(0)\y=ddh-i*8
 points(1)\x=350+zoomx+craquelure2(i)+reduc/7
 points(1)\y=ddh-i*8
 points(2)\x=350+zoomx+craquelure1(i+1)+reduc/7
 points(2)\y=ddh-i*8-8
 points(3)\x=80+zoomx+craquelure2(i+1)-reduc/20
 points(3)\y=ddh-i*8-8
 
 If hdc 
    Box(0,0,0,0,RGB(51,51,255))
    Polygon_(hdc,points(),4) 
 EndIf 
 Next
 reduc*1.035
 Else ; ca disparait ou c'est fixe
 For i=0 To 127
 points(0)\x=80+zoomx+craquelure1(i)
 points(0)\y=ddh-i*8
 points(1)\x=350+zoomx+craquelure2(i)
 points(1)\y=ddh-i*8
 points(2)\x=350+zoomx+craquelure1(i+1)
 points(2)\y=ddh-i*8-8
 points(3)\x=80+zoomx+craquelure2(i+1)
 points(3)\y=ddh-i*8-8
 
 If hdc 
    Box(0,0,0,0,RGB(51,51,255))
    Polygon_(hdc,points(),4) 
 EndIf 
 Next
 EndIf
 
 StopDrawing()
 
 presente+1
 
 If presente>=50
 If presente<120
 DisplaySprite(1,170+zoomx,280)
 ; 140,340 to 290,990
 StartDrawing(ScreenOutput())
 For i=140 To 990 Step 50
 Circle(180+zoomx,i-25,120-presente,RGB(51,51,255))
 Circle(250+zoomx,i+25,120-presente,RGB(51,51,255))
 Next
 ;LineXY(0,0,100,100,RGB(255,0,0))
 StopDrawing()
 ;Else
 ;Displaysprite(1,170,280)
 EndIf
 EndIf
 ; fin d'un long process
 
 If presente<660
 DisplaySprite(0,170+zoomx,70)
 EndIf
 
 EndIf
 EndIf
 
 
 
 
 
 If time<1040


nbb+1
If time>500
;bspline(0,0,200,0,200,200,0,200,RGB(255,180,150),hdc)
vitessex+0.00005
vitessey+0.00002
EndIf
hdc=StartDrawing(ScreenOutput()) ;*********************** S T A R T
;LineXY(30,0,100,100,RGB(255,255,0))

;********** A partir d'ici, tout est "LinkedList"

      ForEach pixel.pixel() ; tant qu'il y a des etoiles on les affiches
              
        With pixel() 
        

          x=\centrex+\posx+\xx+Cos(nbb/1000)*Cos(nbb/100)*nbb/2
          y=\centrey+\posy+\yy+Sin(nbb/100)*Cos(nbb/100)*nbb/2
          \xx*(1+vitessex*2)
          \yy*(1+vitessey*2)
                    
            If x>ddw-2 Or x<1 Or y>ddh-2 Or y<1
            DeleteElement(pixel()) ; on la tue

            Else ; sinon 

            \couleur*(1+vitessex)
            If \couleur>65535
            \couleur=65535
            EndIf
            
            If \couleur<32768
            rvb=\couleur/129
            Plot(x,y,RGB(rvb,rvb,rvb)) ; on l'affiche
            Else
            Plot(x,y,RGB(255,255,255)) ; on l'affiche
            rvb=(\couleur-32768)/130
            Plot(x+1,y,RGB(rvb,rvb,rvb)) ; on l'affiche
            Plot(x-1,y,RGB(rvb,rvb,rvb)) ; on l'affiche
            Plot(x,y+1,RGB(rvb,rvb,rvb)) ; on l'affiche
            Plot(x,y-1,RGB(rvb,rvb,rvb)) ; on l'affiche
            rvb/2
            Plot(x+1,y+1,RGB(rvb,rvb,rvb)) ; on l'affiche
            Plot(x-1,y-1,RGB(rvb,rvb,rvb)) ; on l'affiche
            Plot(x-1,y+1,RGB(rvb,rvb,rvb)) ; on l'affiche
            Plot(x+1,y-1,RGB(rvb,rvb,rvb)) ; on l'affiche
            EndIf


            
            EndIf
            

        EndWith

      Next ; ce "foreach:next" s'addapte donc toujours au vrai nombre d'etoiles

;********** fin de la technique "LinkedList"

;DrawText(50,50,Str(time),RGB(255,50,50),0)
;DrawText(50,100,Str(presente),RGB(255,50,50),0)
;DrawText(50,150,Str(vitessex),RGB(255,50,50),0)
StopDrawing() 

If presente>=120 And presente<400
If presente>=350
DisplaySprite(1,170+zoomx,280+(presente-350)*32)
Else
DisplaySprite(1,170+zoomx,280)
EndIf
EndIf

EndIf



If presente>=500 And presente<815 ;  etoile qui fait disparaitre sph

If presente=500
Dim points.Point(10) 
gro.f=0
f0.f=1.00001
f1.f=1
f2.f=3.14159265/5
EndIf


points(0)\x=216+zoomx+Cos(f1)*Sin(gro)*250
points(0)\y=154+Sin(f1)*Sin(gro)*250
f1+f2
points(1)\x=216+zoomx+Cos(f1)*Sin(gro)*130
points(1)\y=154+Sin(f1)*Sin(gro)*130
f1+f2

points(2)\x=216+zoomx+Cos(f1)*Sin(gro)*250
points(2)\y=154+Sin(f1)*Sin(gro)*250
f1+f2
points(3)\x=216+zoomx+Cos(f1)*Sin(gro)*130
points(3)\y=154+Sin(f1)*Sin(gro)*130
f1+f2

points(4)\x=216+zoomx+Cos(f1)*Sin(gro)*250
points(4)\y=154+Sin(f1)*Sin(gro)*250
f1+f2
points(5)\x=216+zoomx+Cos(f1)*Sin(gro)*130
points(5)\y=154+Sin(f1)*Sin(gro)*130
f1+f2

points(6)\x=216+zoomx+Cos(f1)*Sin(gro)*250
points(6)\y=154+Sin(f1)*Sin(gro)*250
f1+f2
points(7)\x=216+zoomx+Cos(f1)*Sin(gro)*130
points(7)\y=154+Sin(f1)*Sin(gro)*130
f1+f2
points(8)\x=216+zoomx+Cos(f1)*Sin(gro)*250
points(8)\y=154+Sin(f1)*Sin(gro)*250
f1+f2
points(9)\x=216+zoomx+Cos(f1)*Sin(gro)*130
points(9)\y=154+Sin(f1)*Sin(gro)*130
f1+f2

f1+f0-1
f0*1.0003
gro+0.01

hdc=StartDrawing(ScreenOutput()) 
;DrawingMode(#PB_2DDrawing_XOr)
;LineXY(60,0,100,100,RGB(255,0,255))

If hdc 
   Box(0,0,0,0,RGB(255,255,220))
   Polygon_(hdc,points(),10) 
EndIf 
StopDrawing() 
EndIf ; fin de l'etoile qui fait disparaitre sph



FlipBuffers() 

; fin starscrool ********************************************
If time>1255
end
EndIf
Until KeyboardPushed(#PB_Key_Escape)

Dernière modification par SPH le jeu. 10/juil./2014 12:38, modifié 1 fois.

!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Intel Core i7 4770 64 bits - GTX 650 Ti
Version de PB : 6.12LTS- 64 bits
Avatar de l’utilisateur
graph100
Messages : 1318
Inscription : sam. 21/mai/2005 17:50

Re: Rame ou rame pas !!?

Message par graph100 »

ca ne rame pas au début, puis avec l'apparition des trucs bleus, ca rame pas mal, genre 10 fps. Ajoute un compteur FPS tant que t'y es...

et ya une erreur ici :

Code : Tout sélectionner

If time>1255 
	Goto scene2 
	EndIf 
ya pas de label scene2
_________________________________________________
Mon site : CeriseCode (Attention Chantier perpétuel ;))
Avatar de l’utilisateur
SPH
Messages : 4947
Inscription : mer. 09/nov./2005 9:53

Re: Rame ou rame pas !!?

Message par SPH »

tu as quel windows ?

!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Intel Core i7 4770 64 bits - GTX 650 Ti
Version de PB : 6.12LTS- 64 bits
Avatar de l’utilisateur
TazNormand
Messages : 1297
Inscription : ven. 27/oct./2006 12:19
Localisation : Calvados (14)

Re: Rame ou rame pas !!?

Message par TazNormand »

Idem pour moi sur W7 x64, i7 4770K, 16Go de RAM et ATI 7950 3Go.

En tout cas, ça augure du bon et du lourd :D
Image
Image
Avatar de l’utilisateur
graph100
Messages : 1318
Inscription : sam. 21/mai/2005 17:50

Re: Rame ou rame pas !!?

Message par graph100 »

W8 x64, i7 3630QM, 16Go RAM, NVIDIA GTX 670MX

Mais je pense que ça n'a rien a voir avec la config là, nos processeurs sont super bon et ça ram, t'as du charger un truc et c'est pas optimisé.

Juste les étoiles ça ne ram pas, c'est les routes bleus (j'ai trop compris ce que tu cherches à faire, mais bon :) )

Aller ! Optimise nous tout ça !
_________________________________________________
Mon site : CeriseCode (Attention Chantier perpétuel ;))
Avatar de l’utilisateur
majikeyric
Messages : 602
Inscription : dim. 08/déc./2013 23:19
Contact :

Re: Rame ou rame pas !!?

Message par majikeyric »

graph100 a écrit :(j'ai trop compris ce que tu cherches à faire, mais bon :) )
une intro oldskool ? :)
Avatar de l’utilisateur
SPH
Messages : 4947
Inscription : mer. 09/nov./2005 9:53

Re: Rame ou rame pas !!?

Message par SPH »

majikeyric a écrit :
graph100 a écrit :(j'ai trop compris ce que tu cherches à faire, mais bon :) )
une intro oldskool ? :)
Oui

!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Intel Core i7 4770 64 bits - GTX 650 Ti
Version de PB : 6.12LTS- 64 bits
Avatar de l’utilisateur
graph100
Messages : 1318
Inscription : sam. 21/mai/2005 17:50

Re: Rame ou rame pas !!?

Message par graph100 »

ok, mais le principe de la route qui se déroule ? (après perso j'ai pas d'idée pour faire ce genre de truc alors j'attends avec impatience de voir ce que tu vas nous pondre :D )
_________________________________________________
Mon site : CeriseCode (Attention Chantier perpétuel ;))
G-Rom
Messages : 3641
Inscription : dim. 10/janv./2010 5:29

Re: Rame ou rame pas !!?

Message par G-Rom »

Ca rame grave aussi ici avec mon core i7... :mrgreen:
On sent que tu as la niaque :mrgreen:
Backup
Messages : 14526
Inscription : lun. 26/avr./2004 0:40

Re: Rame ou rame pas !!?

Message par Backup »

graph100 a écrit :ok, mais le principe de la route qui se déroule ? (après perso j'ai pas d'idée pour faire ce genre de truc alors j'attends avec impatience de voir ce que tu vas nous pondre :D )
tu la veux en Punch la route qui se deroule ? :mrgreen:
Lemaquis
Messages : 271
Inscription : mer. 25/déc./2013 7:34
Localisation : la corse

Re: Rame ou rame pas !!?

Message par Lemaquis »

c'est super fluide chez moi :)
je suis sous windows 8.1 32 go de ram processeur i7 ma carte graphic à 2 go de ram
LeMaquis
Avatar de l’utilisateur
GallyHC
Messages : 1708
Inscription : lun. 17/déc./2007 12:44

Re: Rame ou rame pas !!?

Message par GallyHC »

Bonjour,

Perso sa rame grave :). Intel i7 (4 cœur "8 thread" - 3.6Ghz). Graphic GeForce GTX 760. 16Go de mémoire.

Voila en gros

GallyHC
Configuration : Tower: Windows 10 (Processeur: i7 "x64") (Mémoire: 16Go) (GeForce GTX 760 - 2Go) - PureBasic 5.72 (x86 et x64)
Avatar de l’utilisateur
Cool Dji
Messages : 1126
Inscription : ven. 05/sept./2008 11:42
Localisation : Besançon
Contact :

Re: Rame ou rame pas !!?

Message par Cool Dji »

Hello,

T'es en 5.30 ?
ça compile pas en 5.22
Only PureBasic makes it possible
Avatar de l’utilisateur
SPH
Messages : 4947
Inscription : mer. 09/nov./2005 9:53

Re: Rame ou rame pas !!?

Message par SPH »

Cool Dji a écrit :Hello,

T'es en 5.30 ?
ça compile pas en 5.22
ca devrait marcher en 5.22

!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Intel Core i7 4770 64 bits - GTX 650 Ti
Version de PB : 6.12LTS- 64 bits
Avatar de l’utilisateur
falsam
Messages : 7324
Inscription : dim. 22/août/2010 15:24
Localisation : IDF (Yvelines)
Contact :

Re: Rame ou rame pas !!?

Message par falsam »

Window7: ça ne rame pas durant bien ....... 4 secondes après c'est l'horreur.
Configuration : Windows 11 Famille 64-bit - PB 6.20 x64 - AMD Ryzen 7 - 16 GO RAM
Vidéo NVIDIA GeForce GTX 1650 Ti - Résolution 1920x1080 - Mise à l'échelle 125%
Répondre