![]() |
Anzeige:
|
|
|||||||
| XProfan Alles rund um die Programmiersprache XProfan. |
|
![]() |
|
|
LinkBack | Themen-Optionen | Ansicht |
|
|
#1 (Direktlink) |
|
Super-Moderator
![]() Registriert seit: 05.02.2009
Ort: Westliches NRW
Alter: 44
Beiträge: 5.094
|
Als Basis zum herum spielen:
Code:
'
' © Frank Abbing für Paules-PC-Forum
' http://www.paules-pc-forum.de/forum/xprofan/
'
$H windows.ph
Declare rect#, region&, x&, y&
Dim rect#, 16
WindowStyle 512 + 26
Cls
~GetWindowRect(%hwnd, rect#)
region& = ~CreateRectRgn(0 ,0, Width(%hwnd), Height(%hwnd))
SetTimer 10
y& = Height(%hwnd)/2
While 1
WaitInput
~ScrollDC(%hdc, -1, 0, 0, 0, region&, rect#)
SetPixel (Width(%hwnd)-2), (Height(%hwnd)/2), RGB(200,200,200)
SetPixel (Width(%hwnd)-2), y&, RGB(0,0,0)
If Rnd(2) = 0
y& = y& + Rnd(4)
Else
y& = y& - Rnd(4)
EndIf
Case y& >= Width(%hwnd): y& = Width(%hwnd)
Case y& <= 0: y& = 0
Case %key=2: BREAK
EndWhile
KillTimer
Dispose rect#
End
__________________
Gruß, Frank ![]() Webpage http://frabbing.bplaced.net mit Freeware - Tools, Spiele und Grafiken. |
|
|
|
|
|
|
#2 (Direktlink) |
|
Dauergast
![]() Registriert seit: 06.02.2009
Ort: Wien, Österreich
Beiträge: 1.082
|
Cool, ein Pseudo Random Walk! Das freut sicher alle MonteCarlo-Simulanten
__________________
Win7-64HomPremSP1,XProfan11.2a,XPIA,JWasm,XPSE,IntelCoreQuad2.5GHz/4GB/je1TB HD intern:esataBay:USB2:USB3 |
|
|
|
|
|
#3 (Direktlink) |
|
Super-Moderator
![]() Registriert seit: 05.02.2009
Ort: Westliches NRW
Alter: 44
Beiträge: 5.094
|
Stimmt, da gabs mal so ein uraltes C64-Spielchen...
__________________
Gruß, Frank ![]() Webpage http://frabbing.bplaced.net mit Freeware - Tools, Spiele und Grafiken. |
|
|
|
|
|
#4 (Direktlink) |
|
Super-Moderator
![]() Registriert seit: 05.02.2009
Ort: Westliches NRW
Alter: 44
Beiträge: 5.094
|
Hier noch mal eine Variation auf einem Static-Control:
Code:
'
' © Frank Abbing für Paules-PC-Forum
' http://www.paules-pc-forum.de/forum/xprofan/
'
$H windows.ph
Declare rect#, region&, x&, y&, static&, dc&
Dim rect#, 16
Def SetWindowPixel(4) ! "gdi32","SetPixel"
WindowStyle 512 + 26
Cls
static& = Create("Text", %hwnd, "", 80, 80, 400, 200)
~GetWindowRect(static&, rect#)
region& = ~CreateRectRgn(Long(rect#,0) ,Long(rect#,4), Width(static&), Height(static&))
SetTimer 10
y& = Height(static&)/2
dc& = ~GetWindowDC(static&)
While 1
WaitInput
~ScrollDC(dc&, -1, 0, 0, 0, region&, rect#)
SetWindowPixel(dc&, (Width(static&)-2), (Height(static&)/2), RGB(200,200,200))
SetWindowPixel(dc&, (Width(static&)-2), y&, RGB(0,0,0))
If Rnd(2) = 0
y& = y& + Rnd(4)
Else
y& = y& - Rnd(4)
EndIf
Case y& >= Width(static&): y& = Width(static&)
Case y& <= 0: y& = 0
Case %key=2: BREAK
EndWhile
KillTimer
Dispose rect#
End
__________________
Gruß, Frank ![]() Webpage http://frabbing.bplaced.net mit Freeware - Tools, Spiele und Grafiken. |
|
|
|
|
|
#5 (Direktlink) |
|
Dauergast
![]() Registriert seit: 06.02.2009
Ort: Wien, Österreich
Beiträge: 1.082
|
TOLL ... und durch eine kleine Änderung von 0 auf 1 lässt sich die Entwicklung des Goldpreises in den letzten Monaten simulieren (Scherz):
Code:
~ScrollDC(dc&, -1, +1), 0, 0, region&, rect#) Code:
~ScrollDC(dc&, -2, 0, 0, 0, region&, rect#)
__________________
Win7-64HomPremSP1,XProfan11.2a,XPIA,JWasm,XPSE,IntelCoreQuad2.5GHz/4GB/je1TB HD intern:esataBay:USB2:USB3 |
|
|
|
|
|
|
#6 (Direktlink) |
|
Super-Moderator
![]() Registriert seit: 05.02.2009
Ort: Westliches NRW
Alter: 44
Beiträge: 5.094
|
Genau, einfach mal rumprobieren.
Interessant dürfte auch sein, wenn mal mal keine rechteckige Region verwendet, sondern z.B. eine runde.
__________________
Gruß, Frank ![]() Webpage http://frabbing.bplaced.net mit Freeware - Tools, Spiele und Grafiken. |
|
|
|
![]() |
|
| Lesezeichen |
| Themen-Optionen | |
| Ansicht | |
|
|
Ähnliche Themen
|
||||
| Thema | Autor | Forum | Antworten | Letzter Beitrag |
| Call Graph 1.0 | Paule | 1.) Internet Tools | 0 | 18.03.2010 07:11 |
| yEd Graph Editor 3.4.1 (Windows) | Paule | 1.) Bürosoftware | 0 | 29.12.2009 22:40 |
| Scrollender Text | Anna | Homepagegestaltung | 6 | 07.04.2006 11:59 |