Autor Beitrag
christian87
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 45



BeitragVerfasst: Mo 15.01.07 18:42 
Hi,

bin neu hier. Ich muss für mein Abitur ein Programm schreiben und dies Vorstellen. Ich habe mir überlegt ein Minigolfspiel zu programmieren.

Zu meinem ersten Problem:

Ich habe einen Ball und möchte die Richtung und die Stärke des Schlages mit Hilfe einer Linie anzeigen lassen. Also der benutzer fhrt mit der Maus hin und her und die Linie wird länger bzw. kürzer oder ändert ihre Richtung.

Die Maus abzufragen habe ich schon hinbekommen. Aber wie zeichne ich so eine Linie?

Ich hoffe meine Erklärung war verständlich. Danke schonmal im Vorraus!
DarkHunter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 477

Win XP
D3 Prof, D2005 PE
BeitragVerfasst: Mo 15.01.07 18:47 
Hallo,

schaue dir doch mal Canvas an, damit solltest du gut bedient sein.
Dürfte auch einiges hier im Forum stehen.

_________________
I believe that every human has a finite number of heart-beats. I don't intend to waste any of mine running around doing exercises.
- Neil Armstrong
F34r0fTh3D4rk
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 5284
Erhaltene Danke: 27

Win Vista (32), Win 7 (64)
Eclipse, SciTE, Lazarus
BeitragVerfasst: Mo 15.01.07 18:48 
das kommt drauf an, wie du dein spiel zeichnest, mit canvas:

ausblenden Delphi-Quelltext
1:
2:
moveto(startX, startY);
lineto(endX, endY);


mit openGL über GL_LINE
christian87 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 45



BeitragVerfasst: Mo 15.01.07 19:16 
Ich zeichne die Linie mit canvas. Hab auch schon einiges rumprobiert. Ich frage die Maus ja mit einem Timer ab. Ich möchte nun das die Linie von einem Punkt aus gezeichnet wird und mit der Maus verläuft. Vielleicht stelle ich mich auch zu blöd an?
jakobwenzel
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1889
Erhaltene Danke: 1

XP home, ubuntu
BDS 2006 Prof
BeitragVerfasst: Mo 15.01.07 19:24 
Wieso nen Timer? Nimm doch einfach OnMouseMove!

_________________
I thought what I'd do was, I'd pretend I was one of those deaf-mutes.
elundril
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3747
Erhaltene Danke: 123

Windows Vista, Ubuntu
Delphi 7 PE "Codename: Aurora", Eclipse Ganymede
BeitragVerfasst: Mo 15.01.07 19:33 
du hast nen fixen punkt. und nen variablem punkt. schon mal mit Canvas beschäftigt???

nette tutorials auf www.dsdt.info

lg el

_________________
This Signature-Space is intentionally left blank.
Bei Beschwerden, bitte den Beschwerdebutton (gekennzeichnet mit PN) verwenden.