ich dachte semicolon ist das -->" ; "
Beiträge von Alizame
-
-
ich finde eher 60% entwickler und 40% user
-
habe jetzt mal eins mit abprallen (weiß nur noch nicht warum BG so grün ist?....)
Spoiler anzeigen
[autoit]#include <GDIPlus.au3>
[/autoit] [autoit][/autoit] [autoit]
#include <GUIConstants.au3>Global $GUIWidth = 800 ;Breite GUI
[/autoit] [autoit][/autoit] [autoit]
Global $GUIHeight = 600 ;Höhe GUI
Global $BallWidth = 20 ;Breite Punkte
Global $BallHeight = 20 ;Höhe Punkte
Global $BallCount = 1 ;Anzahl Punkte
Global $GUIColor = 0xFF00FF00 ;Farbe GUI
Global $BallColor = 0xFFFFFFFF ;Farbe PunkteGlobal $Title = 1
[/autoit] [autoit][/autoit] [autoit]
Global $iX[$BallCount]
Global $iY[$BallCount]
Global $StepX[$BallCount]
Global $StepY[$BallCount]For $i = 0 To $BallCount - 1
[/autoit] [autoit][/autoit] [autoit]
$iX[$i] = Random($BallWidth + 10, $GUIWidth - $BallWidth - 10)
$iY[$i] = Random($BallHeight + 10, $GUIHeight - $BallHeight - 10)
Do
$StepX[$i] = Random(-5, 5, 1)
$StepY[$i] = Random(-5, 5, 1)
Until Not ($StepX[$i] = 0 And $StepY[$i] = 0)
Next$hWnd = GUICreate("Punkteanzahl: " & $BallCount, $GUIWidth, $GUIHeight)
[/autoit] [autoit][/autoit] [autoit]
GUISetState(@SW_SHOW)_GDIPlus_Startup()
[/autoit] [autoit][/autoit] [autoit]Global $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hWnd)
[/autoit] [autoit][/autoit] [autoit]
Global $hBitmap = _GDIPlus_BitmapCreateFromGraphics($GUIWidth, $GUIHeight, $hGraphic)
Global $Buffer = _GDIPlus_ImageGetGraphicsContext($hBitmap)
_GDIPlus_GraphicsSetSmoothingMode($Buffer, 2)
_GDIPlus_GraphicsClear($Buffer, $GUIColor)
Global $hBrush = _GDIPlus_BrushCreateSolid($BallColor)
$bSch = _GDIPlus_BrushCreateSolid(0xFFFFFFFF)AdlibRegister("_Draw", 20)
[/autoit] [autoit][/autoit] [autoit]While 1
[/autoit] [autoit][/autoit] [autoit]
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
AdlibUnRegister()
_GDIPlus_BrushDispose($hBrush)
_GDIPlus_BrushDispose($bSch)
_GDIPlus_GraphicsDispose($Buffer)
_GDIPlus_BitmapDispose($hBitmap)
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_Shutdown()
Exit
EndSwitch
WEndFunc _Draw()
[/autoit] [autoit][/autoit] [autoit][/autoit]
_GDIPlus_GraphicsClear($Buffer, $bSch);$GUIColor)
For $i = 0 To $BallCount - 1
_GDIPlus_GraphicsFillEllipse($Buffer, $iX[$i], $iY[$i], $BallWidth, $BallHeight, $hBrush)
$iX[$i] += $StepX[$i]
$iY[$i] += $StepY[$i]
If $iX[$i] >= ($GUIWidth - $BallWidth) Then $StepX[$i] = $StepX[$i] * - 1
If $iY[$i] >= ($GUIWidth - $BallHeight) - 200 Then $StepY[$i] = $StepY[$i] * - 1
If $iX[$i] <= 0 Then $StepX[$i] = $StepX[$i] * - 1
If $iY[$i] <= 0 Then $StepY[$i] = $StepY[$i] * - 1
Next
_GDIPlus_GraphicsDrawImageRect($hGraphic, $hBitmap, 0, 0, $GUIWidth, $GUIHeight)
EndFunc ;==>_Drawist nen großer teil von name22 weil ich das einfach nicht gebacken gekriegt habe
an name22
ich hoffe das dasin ordnung ist! -
hmm komischer automat....
1,69 € soll ich bezahlen und wenn ich das tue sagt er 5 cent fehlen, wenn ich die 5cent dazu tue sagt er 4cent fehlen, die tue ich dazu --> 1cent fehlet, 1cent dazu, 1ent fehlt 1cent dazu --00,00 rückgeld
-
echt cool!
der oberhammer wäre aber wenn sich die partikel auchoch teilen würden! -
habe sowieso nen anderes projekt weil das hier einfach doof war^^
-
-
versuche das gleich umzusetzen!
Edit:\\ so geht es irgendwie nicht...
kannst du es komplett einbauen?bitte
?Spoiler anzeigen
[autoit]#cs ----------------------------------------------------------------------------
[/autoit] [autoit][/autoit] [autoit]AutoIt Version: 3.3.5.6 (beta)
[/autoit] [autoit][/autoit] [autoit]
Author: AlizameScript Function:
[/autoit] [autoit][/autoit] [autoit]
It make a kometenschweif#ce ----------------------------------------------------------------------------
[/autoit] [autoit][/autoit] [autoit]; Script Start - Add your code below here
[/autoit] [autoit][/autoit] [autoit]
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GDIPlus.au3>
#include <Misc.au3>;###
[/autoit] [autoit][/autoit] [autoit]
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Kometenschweif by Alizame", 800, 600)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
;###$farbewei = 0xFFFFFFFF
[/autoit] [autoit][/autoit] [autoit]
$farbeschwar = 0xFFFFFFFF
$Ball = 40
$iX = 50 ;X Koordinate
$iY = 50 ;Y Koordinate
$vX = 2 ;X Geschwindigkeit
$vY = 3 ;Y Geschwindigkeit_GDIPlus_Startup()
[/autoit] [autoit][/autoit] [autoit]
$hGraphics = _GDIPlus_GraphicsCreateFromHWND($Form1)
$hBitmap = _GDIPlus_BitmapCreateFromGraphics(800,600,$hGraphics)
$Buffer = _GDIPlus_ImageGetGraphicsContext($hBitmap)
$bWei = _GDIPlus_BrushCreateSolid($farbewei)
$bSch = _GDIPlus_BrushCreateSolid($farbeschwar)
$smooth = _GDIPlus_GraphicsSetSmoothingMode($hGraphics,2)
_ReDraw ()While 1
[/autoit] [autoit][/autoit] [autoit]
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
_GDIPlus_ImageDispose($Buffer)
_GDIPlus_BitmapDispose($hBitmap)
_GDIPlus_BrushDispose($bWei)
_GDIPlus_BrushDispose($bSch)
_GDIPlus_GraphicsDispose($hGraphics)
_GDIPlus_Shutdown()
Exit
EndSwitch
;~ If _IsPressed("25") Then $iX -= $bewegung
$iX += $vX
$iY += $vY
;~ If _IsPressed("26") Then $iY -= $bewegung
;~ If _IsPressed("27") Then $iX += $bewegung
;~ If _IsPressed("28") Then $iY += $bewegung
_ReDraw ()
WEndFunc _ReDraw ()
[/autoit] [autoit][/autoit] [autoit]
_PosCorrect ()
_GDIPlus_GraphicsClear($Buffer,$bSch)
_GDIPlus_GraphicsFillEllipse($Buffer,$iX,$iY,$Ball,$Ball,$bWei)
_GDIPlus_GraphicsDrawImageRect($hGraphics,$hBitmap,0,0,800,600)
$iXold = $iX
$iYold = $iY
EndFuncFunc _PosCorrect()
[/autoit]
If $iX >= 350 Then $iX *= -1
EndFunc -
und genau da komme ich nicht weiter,
wie baue ich das ein? -
irgendwie kann man auch die koordinaten zum abprallen mit -1 berechnen, aber kp wie?
-
MsgBox(0,"Start","Pong wird gestartet!")
xD -
KANN man aber ich möchte nicht,
ich möchte so das ichs versteh, gel? -
hmmm..
es macht nachm 3. mal abprallen nen fehler, kreige den aber irgendwie nicht weg!Spoiler anzeigen
[autoit]#cs ----------------------------------------------------------------------------
[/autoit] [autoit][/autoit] [autoit]AutoIt Version: 3.3.5.6 (beta)
[/autoit] [autoit][/autoit] [autoit]
Author: AlizameScript Function:
[/autoit] [autoit][/autoit] [autoit]
It make a kometenschweif#ce ----------------------------------------------------------------------------
[/autoit] [autoit][/autoit] [autoit]; Script Start - Add your code below here
[/autoit] [autoit][/autoit] [autoit]
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GDIPlus.au3>
#include <Misc.au3>;###
[/autoit] [autoit][/autoit] [autoit]
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Kometenschweif by Alizame", 800, 600)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
;###$farbewei = 0xFFFFFFFF
[/autoit] [autoit][/autoit] [autoit]
$farbeschwar = 0xFFFFFFFF
$Ball = 40
$iX = 400
$iY = 300
$iXold = 400
$iYold = 300
$bewegung = 5
$richtung = 1_GDIPlus_Startup()
[/autoit] [autoit][/autoit] [autoit]
$hGraphics = _GDIPlus_GraphicsCreateFromHWND($Form1)
$hBitmap = _GDIPlus_BitmapCreateFromGraphics(800,600,$hGraphics)
$Buffer = _GDIPlus_ImageGetGraphicsContext($hBitmap)
$bWei = _GDIPlus_BrushCreateSolid($farbewei)
$bSch = _GDIPlus_BrushCreateSolid($farbeschwar)
$smooth = _GDIPlus_GraphicsSetSmoothingMode($hGraphics,2)
_ReDraw ()While 1
[/autoit] [autoit][/autoit] [autoit]
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
_GDIPlus_ImageDispose($Buffer)
_GDIPlus_BitmapDispose($hBitmap)
_GDIPlus_BrushDispose($bWei)
_GDIPlus_BrushDispose($bSch)
_GDIPlus_GraphicsDispose($hGraphics)
_GDIPlus_Shutdown()
Exit
EndSwitch
;~ If _IsPressed("25") Then $iX -= $bewegung
If $richtung = 1 Then
$iX -= $bewegung
$iY -= $bewegung
ElseIf $richtung = 2 Then
$iX -= $bewegung
$iY += $bewegung
ElseIf $richtung = 3 Then
$iX += $bewegung
$iY -= $bewegung
ElseIf $richtung = 4 Then
$iX += $bewegung
$iY += $bewegung
EndIf
;~ If _IsPressed("26") Then $iY -= $bewegung
;~ If _IsPressed("27") Then $iX += $bewegung
;~ If _IsPressed("28") Then $iY += $bewegung
If $iX <> $iXold Or $iY <> $iYold Then _ReDraw ()
WEndFunc _ReDraw ()
[/autoit] [autoit][/autoit] [autoit]
_PosCorrect ()
_GDIPlus_GraphicsClear($Buffer,$bSch)
_GDIPlus_GraphicsFillEllipse($Buffer,$iX,$iY,$Ball,$Ball,$bWei)
_GDIPlus_GraphicsDrawImageRect($hGraphics,$hBitmap,0,0,800,600)
$iXold = $iX
$iYold = $iY
EndFuncFunc _PosCorrect()
[/autoit]
If $iX < 0 Then $richtung = 4
If $iY < 0 Then $richtung = 2
If $iX > 760 Then $richtung = 1
If $iY > 560 Then $richtung = 3
ToolTip("x="&$iX&@CRLF&"y="&$iY&@CRLF&$richtung,0,0)
EndFunc -
so versteht man das besser!DANKE!
-
ich habe es hingekriegt!
ball prallt ab!nurnoch richtungen ordentlich bestimmen und siehe da , es geht! -
names pong = nur variablen und 0 sinn für mich
habe es mir bevor ich angefangen habe das angeschaut -
doch!
ich blicke das einfach nicht
ich bin einfach schlecht in berechnungen/formeln/mathe
meine anfänge taten nichts (bewegten nur in eine richtung egal was ich tat -
clezZ
das mit den richtungen musste mir dann nochmal erklären! -
jajaja.
ich wollte euch ja nur testen ob ihr den fehler schön findet!
-
mit berechnungen meine ich die bewegung
dann mus ich die nicht berechnen ujnd kann trotzdem schauen obs ging