AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

PingPong

Ein Thema von NoRiX · begonnen am 5. Mai 2005 · letzter Beitrag vom 14. Feb 2006
 
Benutzerbild von Khabarakh
Khabarakh

Registriert seit: 18. Aug 2004
Ort: Brackenheim VS08 Pro
2.876 Beiträge
 
#11

Re: PingPong

  Alt 6. Mai 2005, 10:43
Nagut, aber bei so etwas verliert man doch den Überblick :
Delphi-Quellcode:
//Ballkollision
if (Abs(ball.Left - enemy.left) <= 5) and (Abs(ball.Top - enemy.Top) <= 5) then xspeed:= -xspeed;
if (ball.top > player1.top -1-toleranz) and (ball.top < player1.top + player1.height +1+toleranz) and (ball.left = player1.left+player1.width) then xspeed := -xspeed;

//Ballkollisions Ton
if (Abs(ball.Left - enemy.left) <= 5) and (Abs(ball.Top - enemy.Top) <= 5) then mp1;
if (ball.top > player1.top -1-toleranz) and (ball.top < player1.top + player1.height +1+toleranz) and (ball.left = player1.left+player1.width) then mp1;
Wie wäre es mit
Delphi-Quellcode:
if (Abs(ball.Left - enemy.left) <= 5) and (Abs(ball.Top - enemy.Top) <= 5)
  or (ball.top > player1.top - 1 - toleranz) and (ball.top < player1.top + player1.height + 1 + toleranz) and (ball.left = player1.left + player1.width) then
begin
  xspeed := -xspeed;
  mp1;
end;
?

Und was ist überhaupt "enemy" und "ball" ? Doch hoffentlich keine TImages ?
Sebastian
Moderator in der EE
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 05:03 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz