Personnage qui court

Programmation avancée de jeux en PureBasic
Avatar de l’utilisateur
SPH
Messages : 4726
Inscription : mer. 09/nov./2005 9:53

Personnage qui court

Message par SPH »

Salut a tous. 8)

Voici un personnage courant a travers l'ecran.
Pouvez vous me dire si vous voyez correctement le personnage d'another world :

Code : Tout sélectionner

;EnableExplicit

;-CONSTANTS
Enumeration
  #MainWindow
  #OpenGLGadget
EndEnumeration

;These two GL constants are used for texture creation. Don't change their values.
#GL_BGR = $80E0
#GL_BGRA = $80E1

If ExamineDesktops()
  ddw=DesktopWidth(0)
  ddh=DesktopHeight(0)
Else
  ddw=1024
  ddh=768
EndIf


;********************* DPI *********************
dpix.f=DesktopResolutionX()
dpiy.f=DesktopResolutionY()

If dpix > 1
xf.f=(1920/ddw)*dpix
Else
   xf = 1
EndIf

If dpiy > 1
yf.f=(1024/ddh)*dpiy
Else
   yf = 1
EndIf
;**********************************************

;-STRUCTURES
Structure Integer2
  X.i
  Y.i
EndStructure
Global.Integer2 WindowDim
WindowDim\X = ddw
WindowDim\Y = ddh


;-DEFINES
Define.i Event
Define.i WindowFlags = #PB_Window_ScreenCentered | #PB_Window_MinimizeGadget


;-DECLARES
Declare Render()
Declare Render2DQuad(OGLTexture.i, StartX.d, StartY.d, Width.i, Height.i, Z.d)
Declare SetupOpenGL()
Declare SetupGLTexture(ImageHandle.i)


;-MAIN WINDOW
win=OpenWindow(#MainWindow, 0, 0,ddw,ddh, "Polygons_Run_2",#PB_Window_Maximize|#PB_Window_BorderLess)
If win=0
  Beep_(500,250) : Delay(150) : Beep_(500,250)
  MessageRequester("Erreur","OpenWindow() impossible")
  End
EndIf

screenGL=OpenGLGadget(#OpenGLGadget,0,0,ddw,ddh)
If screenGL=0
  Beep_(500,250) : Delay(150) : Beep_(500,250)
  MessageRequester("Erreur","OpenGLGadget() impossible")
  End
EndIf


SetupOpenGL()

AddKeyboardShortcut(0,  #PB_Shortcut_Escape, 666) ; quitter


glOrtho_(0,ddw,ddh,0,-1,1)
glMatrixMode_(#GL_MODELVIEW)
glLoadIdentity_()
glClear_(0)

;*********************************************************************************************************************************
;*********************************************************************************************************************************
;*********************************************************************************************************************************
dw2=ddw/2
dh2=ddh/2

dep=1;6
;;;;;;;;;;;
;;;;;;;;;;;
; xx=ddw/2
; yy=ddh/2
;
; origin_x=160
; origin_y=460

;;;;;;;;;;
;;;;;;;;;;;

long=180
Dim poly_mx2(long)
Dim poly_my2(long)
For i=1 To long
  Read.w poly_mx2(i-1)
  Read.w poly_my2(i-1)
Next



; xx=origin_x
; yy=origin_y

;*********************************************************************************************************************************

Dim couleur.f(3,15)
Dim partiex.f(15,12)
Dim partiey.f(15,12)
Dim saut(15)

timer=ElapsedMilliseconds()


Dim angle.f(15)

an1.f=0.1
sens=1

depx=150
depy=ddh/2

glClearColor_(0,0,0, 1.0)

;-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;#################**********************************************
;-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;#################**********************************************
;-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;#################**********************************************
;-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;#################**********************************************
;-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;#################**********************************************
;-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;#################**********************************************
;-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;#################**********************************************
Repeat
 
;     glBlendFunc_(#GL_SRC_ALPHA,0)
;     glBegin_(#GL_POLYGON)
;     glColor4f_(0,0,0,1)
;     glVertex2f_(0,0)
;     glVertex2f_(ddw+1,0)
;     glVertex2f_(ddw+1,ddh+1)
;     glVertex2f_(0,ddh+1)
;     glEnd_()
 
    glClear_(#GL_COLOR_BUFFER_BIT | #GL_DEPTH_BUFFER_BIT)
 
;;;;;;;;;;;;;;;
         
  Dim xx(15)
  Dim yy(15)
 
  Dim xxx(15)
  Dim yyy(15)
 
xx(13)=160:yy(13)=460
; bras devant   
xx(14)=150:yy(14)=260
xx(15)=151:yy(15)=447
    ; bras fond
xx(1)=150:yy(1)=260
xx(2)=151:yy(2)=447
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; jambe fond   
xx(3)=160:yy(3)=460
xx(4)=188:yy(4)=700
; chaussure fond   
xx(5)=189:yy(5)=987
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; jambe visible   
xx(6)=160:yy(6)=460
xx(7)=188:yy(7)=700
; chaussure visible   
xx(8)=189:yy(8)=987
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ; cou
xx(9)=169:yy(9)=198
    ; tete
xx(10)=173:yy(10)=169
xx(11)=173:yy(11)=169
xx(12)=173:yy(12)=169

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;- ================== angle

;==========================
  dep=6*sens
  an1+0.05

angle(1)=Cos(an1)*0.9
angle(2)=-0.5+Cos(an1)*0.9
;an1+0.1
angle(14)=Cos(an1+3.14)*0.9
angle(15)=-0.5+Cos(an1+3.14)*0.9


angle(3)=Cos(an1)*0.7
angle(4)=angle(3)+Cos(an1)*0.5+0.5
angle(5)=angle(3)+Cos(an1)*0.5+0.5
angle(6)=Cos(an1+3.14)*0.7
angle(7)=angle(6)+Cos(an1+3.14)*0.5+0.5
angle(8)=angle(6)+Cos(an1+3.14)*0.5+0.5
;an1+0.1
;an1+0.08

angle(13)=0.2+Cos(an1*2)*0.01
angle(9)=Cos(an1*2)*0.1

angle(10)=0.01+Cos(an1*2)*0.01
angle(11)=angle(10)
angle(12)=angle(10)

i_grec.f=Abs(Cos(an1)*30)
;====




Delay(1)
  depx+dep



nb0=13
    xxx(14)=(xx(14)/xf.f - xx(nb0)) * Cos(angle(nb0)) - (yy(14)/yf.f - yy(nb0)) * Sin(angle(nb0)) +xx(nb0)-xx(14)
    yyy(14)=(xx(14)/xf.f - xx(nb0)) * Sin(angle(nb0)) + (yy(14)/yf.f - yy(nb0)) * Cos(angle(nb0)) +yy(nb0)-yy(14)
nb0=14
    xxx(15)=xxx(14)+(xx(15)/xf.f - xx(nb0)) * Cos(angle(nb0)) - (yy(15)/yf.f - yy(nb0)) * Sin(angle(nb0)) +xx(nb0)-xx(15)
    yyy(15)=yyy(14)+(xx(15)/xf.f - xx(nb0)) * Sin(angle(nb0)) + (yy(15)/yf.f - yy(nb0)) * Cos(angle(nb0)) +yy(nb0)-yy(15)
   
nb0=13
    xxx(1)=(xx(1)/xf.f - xx(nb0)) * Cos(angle(nb0)) - (yy(1)/yf.f - yy(nb0)) * Sin(angle(nb0)) +xx(nb0)-xx(1)
    yyy(1)=(xx(1)/xf.f - xx(nb0)) * Sin(angle(nb0)) + (yy(1)/yf.f - yy(nb0)) * Cos(angle(nb0)) +yy(nb0)-yy(1)
nb0=1
    xxx(2)=xxx(1)+(xx(2)/xf.f - xx(nb0)) * Cos(angle(nb0)) - (yy(2)/yf.f - yy(nb0)) * Sin(angle(nb0)) +xx(nb0)-xx(2)
    yyy(2)=yyy(1)+(xx(2)/xf.f - xx(nb0)) * Sin(angle(nb0)) + (yy(2)/yf.f - yy(nb0)) * Cos(angle(nb0)) +yy(nb0)-yy(2)
   
    ;le cou
nb0=13
    xxx(9)=(xx(9)/xf.f - xx(nb0)) * Cos(angle(nb0)) - (yy(9)/yf.f - yy(nb0)) * Sin(angle(nb0)) +xx(nb0)-xx(9)
    yyy(9)=(xx(9)/xf.f - xx(nb0)) * Sin(angle(nb0)) + (yy(9)/yf.f - yy(nb0)) * Cos(angle(nb0)) +yy(nb0)-yy(9)
   
    ;la tete
nb0=9
    xxx(10)=xxx(9)+(xx(10)/xf.f - xx(nb0)) * Cos(angle(nb0)) - (yy(10)/yf.f - yy(nb0)) * Sin(angle(nb0)) +xx(nb0)-xx(10)
    yyy(10)=yyy(9)+(xx(10)/xf.f - xx(nb0)) * Sin(angle(nb0)) + (yy(10)/yf.f - yy(nb0)) * Cos(angle(nb0)) +yy(nb0)-yy(10)
    xxx(11)=xxx(9)+(xx(11)/xf.f - xx(nb0)) * Cos(angle(nb0)) - (yy(11)/yf.f - yy(nb0)) * Sin(angle(nb0)) +xx(nb0)-xx(11)
    yyy(11)=yyy(9)+(xx(11)/xf.f - xx(nb0)) * Sin(angle(nb0)) + (yy(11)/yf.f - yy(nb0)) * Cos(angle(nb0)) +yy(nb0)-yy(11)
    xxx(12)=xxx(9)+(xx(12)/xf.f - xx(nb0)) * Cos(angle(nb0)) - (yy(12)/yf.f - yy(nb0)) * Sin(angle(nb0)) +xx(nb0)-xx(12)
    yyy(12)=yyy(9)+(xx(12)/xf.f - xx(nb0)) * Sin(angle(nb0)) + (yy(12)/yf.f - yy(nb0)) * Cos(angle(nb0)) +yy(nb0)-yy(12)
   
    ;la jambe du fond
nb0=13
    xxx(3)=xxx(13)+(xx(3)/xf.f - xx(nb0)) * Cos(angle(nb0)) - (yy(3)/yf.f - yy(nb0)) * Sin(angle(nb0)) +xx(nb0)-xx(3)
    yyy(3)=yyy(13)+(xx(3)/xf.f - xx(nb0)) * Sin(angle(nb0)) + (yy(3)/yf.f - yy(nb0)) * Cos(angle(nb0)) +yy(nb0)-yy(3)
nb0=3
    xxx(4)=xxx(3)+(xx(4)/xf.f - xx(nb0)) * Cos(angle(nb0)) - (yy(4)/yf.f - yy(nb0)) * Sin(angle(nb0)) +xx(nb0)-xx(4)
    yyy(4)=yyy(3)+(xx(4)/xf.f - xx(nb0)) * Sin(angle(nb0)) + (yy(4)/yf.f - yy(nb0)) * Cos(angle(nb0)) +yy(nb0)-yy(4)
nb0=4
    xxx(5)=xxx(4)+(xx(5)/xf.f - xx(nb0)) * Cos(angle(nb0)) - (yy(5)/yf.f - yy(nb0)) * Sin(angle(nb0)) +xx(nb0)-xx(5)
    yyy(5)=yyy(4)+(xx(5)/xf.f - xx(nb0)) * Sin(angle(nb0)) + (yy(5)/yf.f - yy(nb0)) * Cos(angle(nb0)) +yy(nb0)-yy(5)
   
    ;la jambe de devant
nb0=13
    xxx(6)=xxx(13)+(xx(6)/xf.f - xx(nb0)) * Cos(angle(nb0)) - (yy(6)/yf.f - yy(nb0)) * Sin(angle(nb0)) +xx(nb0)-xx(6)
    yyy(6)=yyy(13)+(xx(6)/xf.f - xx(nb0)) * Sin(angle(nb0)) + (yy(6)/yf.f - yy(nb0)) * Cos(angle(nb0)) +yy(nb0)-yy(6)
nb0=6
    xxx(7)=xxx(6)+(xx(7)/xf.f - xx(nb0)) * Cos(angle(nb0)) - (yy(7)/yf.f - yy(nb0)) * Sin(angle(nb0)) +xx(nb0)-xx(7)
    yyy(7)=yyy(6)+(xx(7)/xf.f - xx(nb0)) * Sin(angle(nb0)) + (yy(7)/yf.f - yy(nb0)) * Cos(angle(nb0)) +yy(nb0)-yy(7)
nb0=7
    xxx(8)=xxx(7)+(xx(8)/xf.f - xx(nb0)) * Cos(angle(nb0)) - (yy(8)/yf.f - yy(nb0)) * Sin(angle(nb0)) +xx(nb0)-xx(8)
    yyy(8)=yyy(7)+(xx(8)/xf.f - xx(nb0)) * Sin(angle(nb0)) + (yy(8)/yf.f - yy(nb0)) * Cos(angle(nb0)) +yy(nb0)-yy(8)
   
;=============================   
   
nb0=1
nb2=0
ii=0

While poly_my2(nb2)>0
  ii=poly_my2(nb2)
  alpha2.f=poly_mx2(nb2+4)/32767
  ;    glBegin_(#GL_POLYGON)
  If alpha2=1
;     glBlendFunc_(#GL_SRC_ALPHA,0)
    ;      glColor4f_(poly_mx2(nb2+1)/32767,poly_mx2(nb2+2)/32767,poly_mx2(nb2+3)/32767,1)
  Else
;     glBlendFunc_(#GL_SRC_ALPHA,#GL_ONE_MINUS_SRC_ALPHA)
    ;      glColor4f_(poly_mx2(nb2+1)/32767,poly_mx2(nb2+2)/32767,poly_mx2(nb2+3)/32767,alpha2)
  EndIf
 
  For i=1 To 4
    couleur(i-1,nb0)=poly_mx2(nb2+i)/32767
   ;  Debug couleur(i-1,nb0)
  Next
;   Debug ("=")
  partiey(nb0,0)=poly_my2(nb2)-5
  ;Debug partiey(nb0,13)
   
  For i=1 To partiey(nb0,0)
    partiex(nb0,i)=(xxx(nb0)+(poly_mx2(nb2+4+i)/xf.f - xx(nb0)) * Cos(angle(nb0)) - (poly_my2(nb2+4+i)/yf.f - yy(nb0)) * Sin(angle(nb0)) +xx(nb0))/4
    partiey(nb0,i)=(yyy(nb0)+(poly_mx2(nb2+4+i)/xf.f - xx(nb0)) * Sin(angle(nb0)) + (poly_my2(nb2+4+i)/yf.f - yy(nb0)) * Cos(angle(nb0)) +yy(nb0))/4
  Next
 
  nb2+ii
  saut(nb0)=nb2
  nb0+1
Wend;;;;;;;;;;;;;;;;;;;;;

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


;Repeat ; Until xmouse<>xmouse2 Or ymouse<>ymouse2 Or KeyboardPushed(#PB_Key_All)

;*****
  Repeat
    Event = WindowEvent()

    Select Event
      Case #PB_Event_Gadget
        Select EventGadget()
          Case 1
            Resx = GetGadgetAttribute(1, #PB_OpenGL_MouseX)
            Resy = GetGadgetAttribute(1, #PB_OpenGL_MouseY)
            ;;;;;;;         
            Select EventType()
                ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;             
            EndSelect
        EndSelect
      Case #PB_Event_Menu
        Select EventMenu()
          Case 666
          timer=ElapsedMilliseconds()-timer
          ;MessageRequester("Timer", Str(timer)+" ms - "+Str(scene)+" frames",2)
;           Debug scene
;           Debug timer
          End
        EndSelect
    EndSelect
   
  Until Event = 0
 
 
  ;##############################################
  ;##############################################
  ;############Le professeur en polygones :################


For u=1 To 15
  glBegin_(#GL_POLYGON)
 
  If couleur(3,u)=1
    glBlendFunc_(#GL_SRC_ALPHA,0)
    glColor4f_(couleur(0,u),couleur(1,u),couleur(2,u),1)
  Else
    glBlendFunc_(#GL_SRC_ALPHA,#GL_ONE_MINUS_SRC_ALPHA)
    glColor4f_(couleur(0,u),couleur(1,u),couleur(2,u),couleur(3,u))
  EndIf
     
  For i=1 To partiey(u,0)
    glVertex2f_(depx+partiex(u,i)*sens,depy+partiey(u,i)-i_grec)
  Next
 
glEnd_()
Next

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

  SetGadgetAttribute(#OpenGLGadget, #PB_OpenGL_FlipBuffers, #True)
 
;  scene+1
 
If depx>ddw+140
   dep*-1
   depx+dep
   sens=-1
EndIf
If depx<-150
   dep*-1
   depx+dep
      sens=1

EndIf

ForEver




Procedure Render()
 
  ;Clearing buffers and resetting clear color to remove old graphics from the last frame.
  glClear_(#GL_COLOR_BUFFER_BIT | #GL_DEPTH_BUFFER_BIT)
  ;  glClearColor_(0.2, 0.2, 0.2, 1.0)
  glClearColor_(0,0,0,1)
 
  ;## DRAWING TEXTURES/IMAGES
  ;First enable the Texture system.
  glEnable_(#GL_TEXTURE_2D)
 
  ;This procedure will create a quad and apply a texture to it.
  ;The Texture variable contains the texture created earlier using SetupGLTexture().
  Render2DQuad(Texture1, 0, 0, ImageWidth(Image1), ImageHeight(Image1), -2)
  ; Render2DQuad(Texture2, 0, 0, ImageWidth(Image2), ImageHeight(Image2), -1)
 
  ;After all the textures have been displayed disable the texture system.
  ;Otherwise it will conflict with the non texture graphics.
  glDisable_(#GL_TEXTURE_2D)
 
EndProcedure

Procedure Render2DQuad(OGLTexture.i, StartX.d, StartY.d, Width.i, Height.i, Z.d)
 
  ;The texture is first bound which tells OpenGL to use this texture for any future rendering.
  glBindTexture_(#GL_TEXTURE_2D, OGLTexture)
  glBegin_(#GL_QUADS)
  glColor4f_   (1,1,1,1)
  glNormal3f_  (0,0,1.0)
  glTexCoord2f_(1.0,1.0)
  glVertex3f_  (StartX+Width,StartY,Z)
  glTexCoord2f_(0.0,1.0)
  glVertex3f_  (StartX,StartY,Z)
  glTexCoord2f_(0.0,0.0)
  glVertex3f_  (StartX,StartY+Height,Z)
  glTexCoord2f_(1.0,0.0)
  glVertex3f_  (StartX+Width,StartY+Height,Z)
  glEnd_()
 
EndProcedure

Procedure SetupOpenGL()
 
  glMatrixMode_(#GL_PROJECTION)
 
  glOrtho_(0.0, WindowDim\X, WindowDim\Y, 0.0, -1000.0, 1000.0)
 
  glMatrixMode_(#GL_MODELVIEW)
 
  ; glEnable_(#GL_DEPTH_TEST)
 
  glEnable_(#GL_BLEND)
  glBlendFunc_(#GL_SRC_ALPHA, #GL_ONE_MINUS_SRC_ALPHA)
 
EndProcedure



DataSection
Data.w 15, 10, 24158, 0, 15934, 0, 14392, 0, 32767, 0, 127, 281, 178, 280, 187, 357, 179, 469, 133, 469, 0, 13, 24158, 0, 15934, 0, 14392, 0, 32767, 0, 132, 468, 145, 588, 151, 603, 190, 602, 198, 570, 181, 540, 178, 454, 149, 445, 0, 10, 12978, 0, 10794, 0, 11565, 0, 32767, 0, 98, 451, 127, 679, 141, 720
Data.w 230, 716, 223, 446, 0, 10, 12978, 0, 10794, 0, 11565, 0, 32767, 0, 147, 700, 125, 760, 144, 1002, 228, 999, 229, 699, 0, 11, 22230, 0, 18632, 0, 17604, 0, 32767, 0, 140, 986, 123, 1033, 122, 1054, 308, 1054, 303, 1044, 225, 987, 0, 10, 9509, 0, 9509, 0, 9509, 0, 32767, 0, 98, 451, 127, 679, 141, 720
Data.w 230, 716, 223, 446, 0, 10, 9509, 0, 9509, 0, 9509, 0, 32767, 0, 147, 700, 125, 760, 144, 1002, 228, 999, 229, 699, 0, 11, 22230, 0, 18632, 0, 17604, 0, 32767, 0, 140, 986, 123, 1033, 122, 1054, 308, 1054, 303, 1044, 225, 987, 0, 9, 14392, 0, 12079, 0, 12978, 0, 32767, 0, 147, 142, 142, 212, 197, 210
Data.w 200, 148, 0, 17, 21331, 0, 8352, 0, 257, 0, 32767, 0, 208, 52, 254, 90, 245, 56, 211, 36, 158, 37, 125, 66, 119, 100, 145, 166, 182, 151, 201, 107, 215, 97, 238, 75, 0, 12, 14777, 0, 4240, 0, 0, 0, 32767, 0, 167, 120, 165, 94, 133, 58, 121, 79, 117, 103, 147, 166, 183, 159, 0, 17, 25314, 0, 17219, 0
Data.w 15034, 0, 32767, 0, 211, 112, 212, 84, 228, 73, 243, 74, 248, 93, 252, 119, 239, 141, 221, 170, 194, 180, 174, 171, 195, 114, 217, 91, 0, 13, 4112, 0, 4369, 0, 8224, 0, 32767, 0, 229, 480, 78, 482, 97, 332, 95, 242, 122, 208, 147, 191, 207, 194, 235, 256, 13, 10, 24158, 0, 15934, 0, 14392, 0, 32767, 0
Data.w 127, 281, 178, 280, 187, 357, 179, 469, 133, 469, 0, 13, 24158, 0, 15934, 0, 14392, 0, 32767, 0, 132, 468, 145, 588, 151, 603, 190, 602, 198, 570, 181, 540, 178, 454, 149, 445, 0, 0
Data.w 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
EndDataSection
Dernière modification par SPH le sam. 20/févr./2021 9:57, modifié 7 fois.
http://HexaScrabble.com/
!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.00 - 64 bits
Avatar de l’utilisateur
Kwai chang caine
Messages : 6962
Inscription : sam. 23/sept./2006 18:32
Localisation : Isere

Re: Personnage qui court

Message par Kwai chang caine »

Oui mon grand :D
A part, qu'il court "zarebi" ton bonhomme 8O
Mais il court de droite à gauche :wink:
Merci du partage 8)
ImageLe bonheur est une route...
Pas une destination

PureBasic Forum Officiel - Site PureBasic
Avatar de l’utilisateur
SPH
Messages : 4726
Inscription : mer. 09/nov./2005 9:53

Re: Personnage qui court

Message par SPH »

Merci pour ton retour.

Tu le vois comme ca ? : Image
http://xmas.free.fr/AE_bug.bmp
http://HexaScrabble.com/
!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.00 - 64 bits
Avatar de l’utilisateur
Kwai chang caine
Messages : 6962
Inscription : sam. 23/sept./2006 18:32
Localisation : Isere

Re: Personnage qui court

Message par Kwai chang caine »

De rien mon grand :wink:

Non je le vois comme ça 8)

Image
ImageLe bonheur est une route...
Pas une destination

PureBasic Forum Officiel - Site PureBasic
Avatar de l’utilisateur
SPH
Messages : 4726
Inscription : mer. 09/nov./2005 9:53

Re: Personnage qui court

Message par SPH »

Kwai chang caine a écrit :De rien mon grand :wink:

Non je le vois comme ça 8)

Image
Haaa !!!
Ca me fait plaisir mais ca n'explique pas pkoi ca buggue sur mon portable.
Grand merci KCC 8)
http://HexaScrabble.com/
!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.00 - 64 bits
manababel
Messages : 136
Inscription : jeu. 14/mai/2020 7:40

Re: Personnage qui court

Message par manababel »

le personage est demembré

sous windows 7
OpenGL Version : 4.6.0 NVIDIA 411.63
Vidéo Card : GeForce GTX 1060 3GB/PCIe/SSE2
Avatar de l’utilisateur
SPH
Messages : 4726
Inscription : mer. 09/nov./2005 9:53

Re: Personnage qui court

Message par SPH »

manababel a écrit :le personage est demembré
comme ca ?
Image
http://HexaScrabble.com/
!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.00 - 64 bits
manababel
Messages : 136
Inscription : jeu. 14/mai/2020 7:40

Re: Personnage qui court

Message par manababel »

oui
Avatar de l’utilisateur
microdevweb
Messages : 1800
Inscription : mer. 29/juin/2011 14:11
Localisation : Belgique

Re: Personnage qui court

Message par microdevweb »

Salut

Sous Windows 10 ; PB 5.73 ; I7 ; 16GO

Ok :wink:
Windows 10 64 bits PB: 5.70 ; 5.72 LST
Work at Centre Spatial de Liège
Avatar de l’utilisateur
Micoute
Messages : 2522
Inscription : dim. 02/oct./2011 16:17
Localisation : 35520 La Mézière

Re: Personnage qui court

Message par Micoute »

Pas de problème, il marche mieux que moi, car depuis le temps qu'il fait les cent pas, il n'est même pas essoufflé. Merci pour le partage.
Microsoft Windows 10 Famille 64 bits : Carte mère : ASRock 970 Extreme3 R2.0 : Carte Graphique NVIDIA GeForce RTX 3080 : Processeur AMD FX 6300 6 cœurs 12 threads 3,50 GHz PB 5.73 PB 6.00 LTS (x64)
Un homme doit être poli, mais il doit aussi être libre !
Mesa
Messages : 1097
Inscription : mer. 14/sept./2011 16:59

Re: Personnage qui court

Message par Mesa »

Le personnage a les membres tout mélangés comme http://xmas.free.fr/AE_bug.bmp
et il court de gauche à droite et de droite à gauche.
Probablement un probleme de gestion de tampon opengl.

Windows XP 32b, pb 5.73lts, opengl 4.5

M.
Avatar de l’utilisateur
SPH
Messages : 4726
Inscription : mer. 09/nov./2005 9:53

Re: Personnage qui court

Message par SPH »

Je l'ai fait faire des aller retour de gauche a droite et inversement. Ca, c'est normal.

Ce qui m'inquiete, c'est l'eclatement des membres (ou leur regroupement)...
http://HexaScrabble.com/
!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.00 - 64 bits
Avatar de l’utilisateur
Ar-S
Messages : 9477
Inscription : dim. 09/oct./2005 16:51
Contact :

Re: Personnage qui court

Message par Ar-S »

Effectivement l’écart est bien chelou ici :mrgreen:

Ma résolution : 2560 x 1440 en 100% dpi (pas de zoom) porté par un GTX 1080

Image

Je regarde ton code. Déjà au début je ne vois pas l'intérêt de ça :

Code : Tout sélectionner

If ExamineDesktops()
  ddw=DesktopWidth(0)
  ddh=DesktopHeight(0)
Else
  ddw=1024
  ddh=768
EndIf
~~~~Règles du forum ~~~~
⋅.˳˳.⋅ॱ˙˙ॱ⋅.˳Ar-S ˳.⋅ॱ˙˙ॱ⋅.˳˳.⋅
W11x64 PB 6.x
Section HORS SUJET : ICI
LDV MULTIMEDIA : Dépannage informatique & mes Logiciels PB
UPLOAD D'IMAGES : Uploader des images de vos logiciels
Avatar de l’utilisateur
Ar-S
Messages : 9477
Inscription : dim. 09/oct./2005 16:51
Contact :

Re: Personnage qui court

Message par Ar-S »

Change ta partie DPI comme ça :

Code : Tout sélectionner

;********************* DPI *********************
dpix.f=DesktopResolutionX()
dpiy.f=DesktopResolutionY()

If dpix > 1

xf.f=(1920/ddw)*dpix
yf.f=(1024/ddh)*dpiy

Else
  xf = 1
  yf = 1
EndIf
ça marche mieux :)
Image
~~~~Règles du forum ~~~~
⋅.˳˳.⋅ॱ˙˙ॱ⋅.˳Ar-S ˳.⋅ॱ˙˙ॱ⋅.˳˳.⋅
W11x64 PB 6.x
Section HORS SUJET : ICI
LDV MULTIMEDIA : Dépannage informatique & mes Logiciels PB
UPLOAD D'IMAGES : Uploader des images de vos logiciels
Mesa
Messages : 1097
Inscription : mer. 14/sept./2011 16:59

Re: Personnage qui court

Message par Mesa »

Effectivement, une fois le dpi changé, tout est ok.

M.
Répondre