Einen guten Rutsch!

Übersicht Sonstiges Smalltalk

Gehe zu Seite 1, 2  Weiter

Neue Antwort erstellen

mpmxyz

Betreff: Einen guten Rutsch!

BeitragSa, Jan 01, 2011 0:36
Antworten mit Zitat
Benutzer-Profile anzeigen
Wie, es gibt noch keinen Silvesterthread? Shocked
Ich habe extra für diesen Tag ein auf meiner Festplatte verstaubtes Programm von vor einem Jahr ausgegraben!
BlitzBasic: [AUSKLAPPEN]
Global GraphicsW=800;GadgetWidth(Desktop())
Global GraphicsH=600;GadgetHeight(Desktop())
Global windowed=True
Graphics GraphicsW,GraphicsH,32,1+(windowed<>0)
SetBuffer BackBuffer()

Global FPS=60

Global PARTICLES_PER_SHOT=75 ;Standard: 75

Global MAX_PARTICLES=400 ;Standard: 500 (Beeinflusst die Schusshäufigkeit)

Global ENABLE_SMOKE=True ;Raucheffekte: (1=ein)

Global ENABLE_WATER=True ;Wassereffekte: (1=alles ein 2=alles außer Rauchspiegelung)

SetFont LoadFont("",230)

Global boomTime=TimeToS("00:00:00")

Const DAY_SECS=60*60*24
Local startTime=TimeToS(CurrentTime())
DebugLog (startTime>boomTime)
Repeat
Local curTime=TimeToS(CurrentTime())
Cls
Text GraphicsW/2,GraphicsH/2,SToTime((DAY_SECS+boomTime-curTime)Mod DAY_SECS),1,1
AppTitle SToTime((DAY_SECS+boomTime-curTime)Mod DAY_SECS)
Delay 200
Flip 1
If KeyHit(1) Then End
Until (curTime-boomTime)Mod DAY_SECS=0 ;Man verschiebt dieses Programm lieber nicht in der letzten Sekunde... :-P

SetFont LoadFont("",50)


Global timer=CreateTimer(FPS)
SeedRnd MilliSecs()


Const G#=0.07

Const TYPE_FLARE=-2
Const TYPE_SMOKE=-1
Const TYPE_STANDARD=0
Const TYPE_PRE_FLARE=1
Const TYPE_SPLIT=2

AppTitle "Silvester!"

Type Particle
Field x#,y#
Field xs#,ys#
Field xa#,ya#
Field lifeTime#
Field colorR#,colorG#,colorB#
Field typ
Field value
Field splitType
End Type
Global colorR,colorG,colorB

Local flashTime
Local newParticle.Particle
Local i
Global particleCount
Repeat
flashTime=(flashTime+1)Mod 120
Cls

particleCount=0
UpdateFountain()
Update()
Draw()

If MouseDown(1) Or particleCount<=MAX_PARTICLES
GenerateColor(Rand(0,5))
Local typ=Rand(0,2)
Local speed#=Rnd(1,5)
Local startx#=Rnd(0,GraphicsW)
Local starty#=Rnd(0,GraphicsH Shr 1-200)
Local count=Int(speed*PARTICLES_PER_SHOT)
Local value=1
If typ=TYPE_SPLIT
count=count/6
speed=speed*2
value=11
EndIf
Local splitType=Rand(0,1)
For i=0 To count-1
newParticle.Particle = New Particle
newParticle\x# = startx
newParticle\y# = starty
Local dir# = Rnd(360)
newParticle\colorR# = colorR*2+Rnd(-5,5)
newParticle\colorG# = colorG*2+Rnd(-5,5)
newParticle\colorB# = colorB*2+Rnd(-5,5)
Local realSpeed#=Rnd(0,speed)
newParticle\xs# = Cos(dir)*realSpeed+Rnd(-2,+2)
newParticle\ys# = Sin(dir)*realSpeed-Rnd(1,5)-1
newParticle\value=value
InitType(newParticle,typ)
newParticle\splitType=splitType
Next
EndIf

Color 128,128,128
If flashTime<90 Then Text GraphicsW/2,GraphicsH/2,"Silvester!",1,1
WaitTimer timer
Flip 0

;EndIf

Until KeyHit(1)
End


Function TimeToS(time$)
Local h=Mid(time,1,2)
Local m=Mid(time,4,2)
Local s=Mid(time,7,2)
Return h*60*60+m*60+s
End Function

Function SToTime$(time)
Local h$=RSet(Int(Floor(time/60/60)),2)
Local m$=RSet(Int(Floor(time/60))Mod 60,2)
Local s$=RSet(Int(Floor(time))Mod 60,2)

Return h+":"+Replace(m+":"+s," ","0")
End Function

Function SetColor(r,g,b)
If r>255 Then r=255
If r<0 Then r=0
If g>255 Then g=255
If g<0 Then g=0
If b>255 Then b=255
If b<0 Then b=0
Color r,g,b
End Function

Function Draw()
Local p.Particle
LockBuffer BackBuffer()
If ENABLE_SMOKE
For p=Each Particle
If p\typ=TYPE_SMOKE
p\colorR#=p\colorR#*0.95
p\colorG#=p\colorG#*0.95
p\colorB#=p\colorB#*0.95
SetColor Int(p\colorR#),Int(p\colorG#),Int(p\colorB#)
Line Int(p\x),Int(p\y),Int(p\xa#),Int(p\ya#)
If ENABLE_WATER=True
SetColor Int(p\colorR#Shr 1),Int(p\colorG#Shr 1),Int(p\colorB#Shr 1)
If p\y#<GraphicsH Shr 1+25 And p\ya#<GraphicsH Shr 1+25 Then Line Int(p\x)+Rnd(-1,+1),Int(GraphicsH+50-p\y)+Rnd(-1,+1),Int(p\xa#)+Rnd(-1,+1),Int(GraphicsH+50-p\ya#)+Rnd(-1,+1)
EndIf
EndIf
Next
EndIf
For p=Each Particle
SetColor Int(p\colorR#),Int(p\colorG#),Int(p\colorB#)
Select p\typ
Case TYPE_STANDARD, TYPE_PRE_FLARE, TYPE_SPLIT
Line Int(p\x),Int(p\y),Int(p\xa#),Int(p\ya#)
If ENABLE_WATER<>0
SetColor Int(p\colorR# Shr 1),Int(p\colorG# Shr 1),Int(p\colorB# Shr 1)
If p\y#<GraphicsH Shr 1+25 And p\ya#<GraphicsH Shr 1+25 Then Line Int(p\x)+Rnd(-1,+1),Int(GraphicsH+50-p\y)+Rnd(-1,+1),Int(p\xa#)+Rnd(-1,+1),Int(GraphicsH+50-p\ya#)+Rnd(-1,+1)
EndIf
End Select
Next
UnlockBuffer BackBuffer()
For p=Each Particle
SetColor Int(p\colorR#),Int(p\colorG#),Int(p\colorB#)
Local randomNumber=Rand(0,2)
If p\typ=TYPE_FLARE
If randomNumber=1 Then Oval Int(p\x),Int(p\y),Rnd(1,3),Rnd(1,3)
p\ys# = p\ys#*0.9
p\xs# = p\xs#*0.9
p\colorR# = p\colorR#*0.99
p\colorG# = p\colorG#*0.99
p\colorB# = p\colorB#*0.99
p\x = p\x + Rnd(-1,+1) + p\xs#
p\y = p\y + Rnd(-1,+1) + p\ys#
If ENABLE_WATER<>0
SetColor Int(p\colorR# Shr 1),Int(p\colorG# Shr 1),Int(p\colorB# Shr 1)
If randomNumber=1 And p\y#<GraphicsH Shr 1+25 Then Oval Int(p\x)+Rnd(-1,+1),Int(GraphicsH+50-p\y)+Rnd(-1,+1),Rnd(2,4),Rnd(2,4)
EndIf
EndIf
Next
End Function

Function Update()
Local p.Particle
Local newParticle.Particle
Local i
For p.Particle = Each Particle
particleCount=particleCount+p\value
If p\typ<>TYPE_SMOKE And p\typ<>TYPE_FLARE
p\xa# = p\x#
p\ya# = p\y#
p\x# = p\x# + p\xs#
p\y# = p\y# + p\ys#
EndIf
p\ys# = p\ys#*0.999 + G
p\xs# = p\xs#*0.999
p\colorR# = p\colorR#*0.96
p\colorG# = p\colorG#*0.96
p\colorB# = p\colorB#*0.96


If p\typ=TYPE_SPLIT And p\lifeTime#>50+Rnd(10) And p\lifeTime#<60


Local dir# = Rnd(360)
Local speed# = Rnd(2,5)
p\x# = p\x#
p\y# = p\y#
p\xs# = Cos(dir)*speed
p\ys# = Sin(dir)*speed
p\xa# = p\xa#
p\ya# = p\ya#
p\colorR# = p\colorR#*2
p\colorG# = p\colorG#*2
p\colorB# = p\colorB#*2
p\typ = TYPE_STANDARD
p\value = 1
For i=0 To 10
newParticle = New Particle
dir = Rnd(360)
speed = Rnd(2,5)
newParticle\x# = p\x#
newParticle\y# = p\y#
newParticle\xs# = Cos(dir)*speed
newParticle\ys# = Sin(dir)*speed
newParticle\xa# = p\xa#
newParticle\ya# = p\ya#
newParticle\colorR# = p\colorR#*2
newParticle\colorG# = p\colorG#*2
newParticle\colorB# = p\colorB#*2
InitType(newParticle,p\splitType)
newParticle\value = 1
Next

EndIf

If p\typ=TYPE_PRE_FLARE
p\colorR# = p\colorR#*0.99
p\colorG# = p\colorG#*0.99
p\colorB# = p\colorB#*0.99
p\ys# = p\ys#*0.999
p\xs# = p\xs#*0.999
If p\lifeTime#>64
p\typ = TYPE_FLARE
p\colorR# = 255
p\colorG# = 255
p\colorB# = 255
p\lifeTime# = 200
EndIf
EndIf

If ENABLE_SMOKE
If p\typ<>TYPE_SMOKE And p\typ<>TYPE_FLARE
newParticle = New Particle
newParticle\x# = p\x#
newParticle\y# = p\y#
newParticle\xa# = p\xa#
newParticle\ya# = p\ya#
newParticle\colorR# = ((p\colorR#+p\colorR#+p\colorG#+p\colorB#) Shr 2)*0.8+Rnd(0,2)
newParticle\colorG# = ((p\colorR#+p\colorG#+p\colorG#+p\colorB#) Shr 2)*0.8+Rnd(0,2)
newParticle\colorB# = ((p\colorR#+p\colorG#+p\colorB#+p\colorB#) Shr 2)*0.8+Rnd(0,2)
newParticle\lifeTime=350;390
newParticle\typ=-1
EndIf
EndIf




p\lifeTime#=p\lifeTime#+1
If p\typ<>TYPE_SPLIT
If p\y#>GraphicsH Shr 1+25+Rnd(5) Or p\x<0 Or p\x>GraphicsW Or (p\colorR#<5 And p\colorG#<5 And p\colorB#<5) Then Delete p
If p<>Null
If p\colorR+p\colorG+p\colorB<10 Then Delete p
EndIf
Else
If p\y#>GraphicsH Shr 1+25+Rnd(5) Then Delete p
EndIf
Next
End Function

Global fountainTime
Global colorTime
Global colorR2,colorG2,colorB2
Function UpdateFountain()
If colorTime=0
GenerateColor(Rand(0,5))
colorR2=colorR
colorG2=colorG
colorB2=colorB
colorTime=120
ElseIf colorTime>0
colorTime=colorTime-1
EndIf
If fountainTime=0
Local i
For i=0 To 4
Local typ=Rand(0,1)*2
Local speed#=Rnd(1,5)
Local startx=GraphicsW*(1+2*i)/10+Rnd(-5,5)
Local starty=GraphicsH/2+24
Local value=1
If typ=TYPE_SPLIT
speed=speed*2
value=11
EndIf
Local newParticle.Particle = New Particle
newParticle\x# = startx
newParticle\y# = starty
Local dir# = Rnd(-45,45)
newParticle\colorR# = colorR2*2+Rnd(-5,5)
newParticle\colorG# = colorG2*2+Rnd(-5,5)
newParticle\colorB# = colorB2*2+Rnd(-5,5)
Local realSpeed=Rnd(0,speed)
newParticle\xs# = Sin(dir)*realSpeed+Rnd(-2,+2)
newParticle\ys# = -Cos(dir)*realSpeed-Rnd(1,5)-1
newParticle\value=value
newParticle\splitType=Rand(0,1)
InitType(newParticle,typ)
Next
fountainTime=10
ElseIf fountainTime>0
fountainTime=fountainTime-1
EndIf
End Function
Function GenerateColor(id)
Select id
Case 0
colorR=200
colorG=50
colorB=25
Case 1
colorR=255
colorG=255
colorB=30
Case 2
colorR=250
colorG=250
colorB=250
Case 3
colorR=50
colorG=50
colorB=250
Case 4
colorR=50
colorG=250
colorB=50
Case 5
colorR=250
colorG=150
colorB=150
End Select
End Function
Function InitType(p.Particle,typ)
Select typ
Case TYPE_SPLIT
p\typ=TYPE_SPLIT
Case TYPE_PRE_FLARE
If Rand(0,1)=0
p\typ=TYPE_PRE_FLARE
p\lifeTime=50
EndIf
End Select
End Function

Das stammt noch aus meinen Anfangszeiten. Daher musste ich es erst einmal noch etwas aufpolieren, bevor es an die Öffentlichkeit gelassen werden konnte. Razz
Ich wünsche allen einen guten Rutsch ins neue Jahr!
mpmxyz
Moin Moin!
Projekte: DBPC CodeCruncher Mandelbrot-Renderer
 

102030

BeitragSa, Jan 01, 2011 0:42
Antworten mit Zitat
Benutzer-Profile anzeigen
guten Rutsch ins neue Jahr!!!
Nur noch 19 Minuten Very Happy Smile Surprised Shocked Cool Laughing Razz
Mal sehen wie viele Leute ich dieses Jahr mal wieder abschieße Twisted Evil Wink Twisted Evil


Edit: Als ich das geschrieben habe waren es noch 19 Minuten...

ToeB

BeitragSa, Jan 01, 2011 2:25
Antworten mit Zitat
Benutzer-Profile anzeigen
Frohes neues Jahr euch allen !

Viel erfolg bei euren Projekten und viel Glück !

mfg ToeB
Religiöse Kriege sind Streitigkeiten erwachsener Männer darum, wer den besten imaginären Freund hat.
Race-Project - Das Rennspiel der etwas anderen Art
SimpleUDP3.0 - Neuste Version der Netzwerk-Bibliothek
Vielen Dank an dieser Stelle nochmal an Pummelie, welcher mir einen Teil seines VServers für das Betreiben meines Masterservers zur verfügung stellt!

Der Eisvogel

BeitragSa, Jan 01, 2011 2:26
Antworten mit Zitat
Benutzer-Profile anzeigen
Hi, frohes neuses Jahr euch allen! Jetzt müssen die Mützen ja schon fast wieder weg. Sad

MfG
Der Eisvogel
Ungarische Notation kann nützlich sein.
BlitzMax ; Blitz3D
Win 7 Pro 64 Bit ; Intel Core i7-860 ; 8 GB Ram ; ATI HD 5750 1 GB
Projekte: Window-Crasher
Ich liebe es mit der WinAPI zu spielen.
 

Sterbendes Lüftlein

BeitragSa, Jan 01, 2011 2:47
Antworten mit Zitat
Benutzer-Profile anzeigen
Text entfernt

Pummelie

BeitragSa, Jan 01, 2011 2:50
Antworten mit Zitat
Benutzer-Profile anzeigen
user posted image
It's done when it's done.

Silver_Knee

BeitragSa, Jan 01, 2011 5:43
Antworten mit Zitat
Benutzer-Profile anzeigen
Proscht neijohr

Rallimen

Sieger des 30-EUR-Wettbewerbs

BeitragSa, Jan 01, 2011 10:32
Antworten mit Zitat
Benutzer-Profile anzeigen
Ich hoffe das Ihr alle gut durchgerutscht seid und wünsche euch allen ein Frohes Neues Jahr .
[BB2D | BB3D | BB+]

count-doku

BeitragSa, Jan 01, 2011 11:23
Antworten mit Zitat
Benutzer-Profile anzeigen
Frohes Neues Exclamation
 

#Reaper

Newsposter

BeitragSa, Jan 01, 2011 13:13
Antworten mit Zitat
Benutzer-Profile anzeigen
Frohes neues Jahr wünsche ich ebenfalls allen! Very Happy
AMD Athlon 64 3500+, ATI AX800 Pro/TD, 2048 MB DRR 400 von Infineon, ♥RIP♥ (2005 - Juli 2015 -> sic!)
Blitz3D, BlitzMax, MaxGUI, Monkey X; Win7

StarGazer

BeitragSa, Jan 01, 2011 13:36
Antworten mit Zitat
Benutzer-Profile anzeigen
Frohes neues, erfolgreiches, tatkräftges Jahr Very Happy

ZaP

BeitragSa, Jan 01, 2011 13:57
Antworten mit Zitat
Benutzer-Profile anzeigen
Frohes neues! Mr. Green
Starfare: Worklog, Website (download)

Lord Stweccys

BeitragSa, Jan 01, 2011 14:35
Antworten mit Zitat
Benutzer-Profile anzeigen
Frohes neues Jahr euch allen Very Happy

Megamag

BeitragSa, Jan 01, 2011 15:17
Antworten mit Zitat
Benutzer-Profile anzeigen
Frohes Neues! Very Happy
Mein DeviantArt Profil
Gewinner des BAC #136

Tennisball

BeitragSa, Jan 01, 2011 15:19
Antworten mit Zitat
Benutzer-Profile anzeigen
Froher neues Jahr und viel Erfolg bei euren Blitz-Projekten und so. Wink

C--

BeitragSa, Jan 01, 2011 17:06
Antworten mit Zitat
Benutzer-Profile anzeigen
01000110 01110010 01101111 01101000 01100101 01110011 01001110 01100101 01110101 01100101 01110011 Very Happy

Kernle 32DLL

BeitragSa, Jan 01, 2011 18:25
Antworten mit Zitat
Benutzer-Profile anzeigen
Auch von mir ein Frohes Neues Jahr,

Und wo Eisvogel es schon angesprochen hat....

Zitat:
[...]Am Fest Darstellung des Herrn klingt die Weihnachtszeit nach[...]

http://de.wikipedia.org/wiki/W...irchenjahr

Zitat:
Darstellung des Herrn oder Mariä Lichtmess (früher auch: Mariä Reinigung, Purificatio Mariae) ist der vierzigste Tag nach Weihnachten, der in einigen christlichen Konfessionen am 2. Februar gefeiert wird.

http://de.wikipedia.org/wiki/Darstellung_des_Herrn

=> Mützen und Avatare bleiben bis zum 2. Februar, und der Weihnachtsbaum wird auch erst am 2. Februar entsorgt!
Mein PC: "Bluelight" - Xtreme Gamer PC [Video]
Meine Projekte: Cube-Wars 2010 [Worklog]
Anerkennungen: 1. Platz BCC #7 , 1. Platz BCC #22 , 3. Platz BAC #89
Ich war dabei: NRW Treff III, IV ; Frankfurter BB Treffen 2009

Tankbuster

BeitragSa, Jan 01, 2011 18:37
Antworten mit Zitat
Benutzer-Profile anzeigen
Ich wünsch euch auch ein frohes neues Jahr Smile
Und, was habt ihr euch so an guten Vorsetzen zugelegt?

Ich hab beschlossen, mindestens ein halbes Jahr kein Geld mehr für Tabakwaren zu verbrauchen, und will auch versuchen das durchzuziehen.

Es ist ja immer so eine Sache, weil die meisten Menschen das, was sie sich fürs nächste Jahr vornehmen, ab der Stunde NULL oder spätestens dem 29igsten Januar schonwieder vergessen haben.
Aber ich will der Regel treu bleiben, ich denke das ist machbar und praktisch =)
Twitter
Download Jewel Snake!
Windows|Android

DaysShadow

BeitragSa, Jan 01, 2011 20:04
Antworten mit Zitat
Benutzer-Profile anzeigen
Frohes Neues und so, die Herrschaften Wink
Blessed is the mind too small for doubt

Thunder

BeitragSa, Jan 01, 2011 22:16
Antworten mit Zitat
Benutzer-Profile anzeigen
Frohes neues Jahr! Very Happy
Meine Sachen: https://bitbucket.org/chtisgit https://github.com/chtisgit

Gehe zu Seite 1, 2  Weiter

Neue Antwort erstellen


Übersicht Sonstiges Smalltalk

Gehe zu:

Powered by phpBB © 2001 - 2006, phpBB Group