Jeux

nico20011caus Messages postés 37 Date d'inscription jeudi 23 décembre 2004 Statut Membre Dernière intervention 14 février 2009 - 13 déc. 2006 à 02:13
cptpingu Messages postés 3837 Date d'inscription dimanche 12 décembre 2004 Statut Modérateur Dernière intervention 28 mars 2023 - 13 déc. 2006 à 22:21
Bonjour à vous
 je fait un jeux comme pin ball mais je n'arrive pas a faire des collisions avec les "shapes".
Si vous pouvez maider sa serait tres aprécier.
 merci

2 réponses

f0xi Messages postés 4205 Date d'inscription samedi 16 octobre 2004 Statut Modérateur Dernière intervention 12 mars 2022 35
13 déc. 2006 à 21:27
HOULALA!

faire un pinball avec des shapes ..... mon ami voyons!

utilise les regions par exemple :

var
  BallRgn : HRGN;

function CreateRoundRgn(const aRect : TRect) : HRGN;
begin
  result := CreateEllipticRgn(aRect.Left, aRect.Top, aRect.Right, aRect.Bottom);
end;

procedure SetRgnPosition(const aRgn : HRGN; const aX,aY : integer);
begin
  OffsetRgn(aRgn, aX,aY);
end;

function CollideWithPnt(const aRgn : HRGN; const aPntX, aPntY : integer) : boolean;
begin
  result := PtInRegion(aRgn,aPntX,aPntY);
end;

function CollideWithRect(const aRgn : HRGN; const aRect : TRect) : boolean;
begin
  result := RectInRegion(aRgn,aRect);
end;

<hr size="2" width="100%" />Croc (click me)
0
cptpingu Messages postés 3837 Date d'inscription dimanche 12 décembre 2004 Statut Modérateur Dernière intervention 28 mars 2023 123
13 déc. 2006 à 22:21
En OpenGL, ca serait plus joli, non ?
0
Rejoignez-nous