Page 1 of 2

Happy New Year to PureBasic people!

Posted: Thu Dec 31, 2015 11:06 pm
by Danilo
Happy new year PureBasic guys and girls! May the new versions of PB enlighten you!

Skoal!
Prost!
Cheers!
Tchin-tchin! Santé!
¡Salud!
Cincin! Alla salute!
¡Chinchín! ¡Salud!
干杯! [乾杯!] Gānbēi!
ва́ше здоро́вье!
Tchim tchim!
na zdrowie!
To your health!

Re: Happy New Year to PureBasic people!

Posted: Thu Dec 31, 2015 11:25 pm
by Shield
新年快乐!

Re: Happy New Year to PureBasic people!

Posted: Thu Dec 31, 2015 11:40 pm
by RSBasic
Feliz año nuevo :)

Re: Happy New Year to PureBasic people!

Posted: Thu Dec 31, 2015 11:52 pm
by magicjo
Auguri a tutti
Image

Re: Happy New Year to PureBasic people!

Posted: Fri Jan 01, 2016 12:16 am
by nco2k
happy new year everyone! :D

c ya,
nco2k

Re: Happy New Year to PureBasic people!

Posted: Fri Jan 01, 2016 12:52 am
by leonhardt
Shield wrote:新年快乐!
还有中国人的说?

Re: Happy New Year to PureBasic people!

Posted: Fri Jan 01, 2016 1:30 am
by TI-994A
Here's wishing one and all...

Image

May it be a truly good one, if not better! :D

Re: Happy New Year to PureBasic people!

Posted: Fri Jan 01, 2016 5:55 am
by useful
Image

Re: Happy New Year to PureBasic people!

Posted: Fri Jan 01, 2016 10:35 am
by Fred
Happy new year !

Re: Happy New Year to PureBasic people!

Posted: Fri Jan 01, 2016 12:17 pm
by thanos
Καλή χρονιά!

Re: Happy New Year to PureBasic people!

Posted: Fri Jan 01, 2016 1:03 pm
by Zebuddi123
Happy New Year to All :)

Re: Happy New Year to PureBasic people!

Posted: Fri Jan 01, 2016 1:55 pm
by mpz
A happy new year and great projects with purebasic...

Michael

Re: Happy New Year to PureBasic people!

Posted: Fri Jan 01, 2016 2:03 pm
by Shield
leonhardt wrote:
Shield wrote:新年快乐!
还有中国人的说?
我不是中国人但是我在学习中文。
Though now we're already off topic. :)

Re: Happy New Year to PureBasic people!

Posted: Fri Jan 01, 2016 4:53 pm
by STARGÅTE

Code: Select all

EnableExplicit

InitSprite()

Structure Vector
   X.f
   Y.f
EndStructure

Structure Spark
   Position.Vector
   Velocity.Vector
   Time.i
   Color.i
   Blink.i
   Weight.i
EndStructure

Structure Bullet
   Position.Vector
   Velocity.Vector
   Time.i
   Color.i
   Weight.i
   Type.i
EndStructure

Global NewList Bullet.Bullet()
Global NewList Spark.Spark()

Enumeration
   #Window
EndEnumeration

OpenWindow(#Window, 0, 0, 1200, 800, "ScreenTitle", #PB_Window_SystemMenu|#PB_Window_ScreenCentered)
OpenWindowedScreen(WindowID(#Window), 0, 0, WindowWidth(#Window), WindowHeight(#Window), 0, 0, 0)
RandomSeed(4)

Define Time.i, OldTime.i, TimeFactor.f, Length.f, I.i, Angle.f, Radius.f, Factor.f, *Spark.Spark

Repeat
   
   Repeat
      Select WindowEvent()
         Case #PB_Event_CloseWindow
            End
         Case #PB_Event_None
            Break
      EndSelect
   ForEver
   
   ClearScreen(0)
   
   Time = ElapsedMilliseconds()
   TimeFactor = (Time-OldTime)*0.001
   OldTime = Time
   
   StartDrawing(ScreenOutput())
   
   ForEach Spark()
      Spark()\Position\X + Spark()\Velocity\X*TimeFactor
      Spark()\Position\Y + Spark()\Velocity\Y*TimeFactor
      Spark()\Velocity\Y + 98.1*TimeFactor
      If Time > Spark()\Time-250
         Factor = (Spark()\Time-Time)/250.
      Else
         Factor = 1.0
      EndIf
      If Spark()\Weight Or Spark()\Blink
         Circle(Spark()\Position\X, Spark()\Position\Y, Spark()\Blink+Sqr(Spark()\Weight/100), RGB(Red(Spark()\Color)*(Factor*0.5+0.5), Green(Spark()\Color)*(Factor*0.5+0.5), Blue(Spark()\Color)*(Factor*0.5+0.5)))
      Else
         Line(Spark()\Position\X, Spark()\Position\Y, 1, 1, RGB(Red(Spark()\Color)*Factor, Green(Spark()\Color)*Factor, Blue(Spark()\Color)*Factor))
      EndIf
      If Spark()\Blink
         *Spark = Spark()
         Angle = Radian(Random(3600)/10.)
         Radius = Sqr(Random(1000)/1000.)*10
         AddElement(Spark())
         Spark()\Position = *Spark\Position
         ;Spark()\Velocity = *Spark\Velocity
         Spark()\Velocity\X + Cos(Angle)*Radius
         Spark()\Velocity\Y + Sin(Angle)*Radius
         Spark()\Color = $40B0F0 + (Random($F)|Random($F)<<8|Random($F)<<16)
         Spark()\Time = Time + 250 + Random(250)
      ChangeCurrentElement(Spark(), *Spark)
      EndIf
      If Time > Spark()\Time
         If Spark()\Weight
            *Spark = Spark()
            For I = 1 To *Spark\Weight
               Angle = Radian(Random(3600)/10.)
               Radius = Sqr(Random(1000)/1000.)*40+10
               AddElement(Spark())
               Spark()\Position = *Spark\Position
               Spark()\Velocity = *Spark\Velocity
               Spark()\Velocity\X + Cos(Angle)*Radius
               Spark()\Velocity\Y + Sin(Angle)*Radius
               Spark()\Color = $40B0F0 + (Random($F)|Random($F)<<8|Random($F)<<16)
               Spark()\Time = Time + 250 + Random(250)
            Next
            ChangeCurrentElement(Spark(), *Spark)
         EndIf
         DeleteElement(Spark())
      EndIf
   Next

   ForEach Bullet()
      Bullet()\Position\X + Bullet()\Velocity\X*TimeFactor
      Bullet()\Position\Y + Bullet()\Velocity\Y*TimeFactor
      Bullet()\Velocity\Y + 98.1*TimeFactor
      Length = Sqr(Bullet()\Velocity\X*Bullet()\Velocity\X+Bullet()\Velocity\Y*Bullet()\Velocity\Y)
      Circle(Bullet()\Position\X, Bullet()\Position\Y, 1+Sqr(Bullet()\Weight/100), $C0C0C0)
      LineXY(Bullet()\Position\X, Bullet()\Position\Y, Bullet()\Position\X-Bullet()\Velocity\X*20/Length, Bullet()\Position\Y-Bullet()\Velocity\Y*20/Length, $808080)
      If Bullet()\Time < Time
         Select Bullet()\Type
            Case 0
               For I = 1 To Bullet()\Weight
                  Angle = Radian(Random(3600)/10.)
                  Radius = Pow(Random(1000)/1000., 0.25)*Sqr(Bullet()\Weight)*5
                  AddElement(Spark())
                  Spark()\Position = Bullet()\Position
                  Spark()\Velocity = Bullet()\Velocity
                  Spark()\Velocity\X + Cos(Angle)*Radius
                  Spark()\Velocity\Y + Sin(Angle)*Radius
                  Spark()\Color = Bullet()\Color + (Random($F)|Random($F)<<8|Random($F)<<16)
                  Spark()\Time = Time + 1000 + Random(1000)
               Next
            Case 1
               For I = 1 To Bullet()\Weight/10
                  Angle = Radian(Random(3600)/10.)
                  Radius = Sqr(Random(1000)/1000.)*Sqr(Bullet()\Weight)*5
                  AddElement(Spark())
                  Spark()\Position = Bullet()\Position
                  Spark()\Velocity = Bullet()\Velocity
                  Spark()\Velocity\X + Cos(Angle)*Radius
                  Spark()\Velocity\Y + Sin(Angle)*Radius
                  Spark()\Color = Bullet()\Color + (Random($F)|Random($F)<<8|Random($F)<<16)
                  Spark()\Time = Time + 500 + Random(500)
                  Spark()\Weight = 50
               Next
            Case 2
               For I = 1 To Bullet()\Weight/10
                  Angle = Radian(Random(3600)/10.)
                  Radius = Sqr(Random(1000)/1000.)*Sqr(Bullet()\Weight)*5
                  AddElement(Spark())
                  Spark()\Position = Bullet()\Position
                  Spark()\Velocity = Bullet()\Velocity
                  Spark()\Velocity\X + Cos(Angle)*Radius
                  Spark()\Velocity\Y + Sin(Angle)*Radius
                  Spark()\Color = Bullet()\Color + (Random($F)|Random($F)<<8|Random($F)<<16)
                  Spark()\Time = Time + 2500 + Random(500)
                  Spark()\Blink = #True
               Next
         EndSelect
         DeleteElement(Bullet())
      ElseIf Random(1) = 0
         Radius = Random(50)+50
         Angle = Radian(Random(100)/10.-5) + ATan2(Bullet()\Velocity\X, Bullet()\Velocity\Y)
         AddElement(Spark())
         Spark()\Position = Bullet()\Position
         Spark()\Velocity = Bullet()\Velocity
         Spark()\Velocity\X - Cos(Angle)*Radius
         Spark()\Velocity\Y - Sin(Angle)*Radius
         Spark()\Color = $40B0F0 + (Random($F)|Random($F)<<8|Random($F)<<16)
         Spark()\Time = Time + 1000 + Random(1000)
      EndIf
   Next
   
   If Random(20) = 0
      Angle = Radian(Random(400)/10.+250)
      AddElement(Bullet())
      Bullet()\Position\X = ScreenWidth()/2 - 100 + Random(200)
      Bullet()\Position\Y = ScreenHeight()
      Bullet()\Velocity\X = Cos(Angle)*350
      Bullet()\Velocity\Y = Sin(Angle)*350
      Bullet()\Color = PeekI(?Color+Random(5)*SizeOf(Integer))
      Bullet()\Time = Time + 2000 + Random(500)
      Bullet()\Weight = 100+Random(800)
      Bullet()\Type = Random(2)
   EndIf
   
   StopDrawing()
   
   FlipBuffers()
   
ForEver

DataSection
   Color:
   Data.i $4060F0, $00F040, $F08040, $00D0F0, $F040C0, $F0F0F0
EndDataSection

Re: Happy New Year to PureBasic people!

Posted: Fri Jan 01, 2016 5:22 pm
by ar-s
Happy new year ! Bonne année à tous !

@STARGÅTE : Image