Author Topic: Plasma  (Read 2973 times)

0 Members and 1 Guest are viewing this topic.

Peter

  • Guest
Plasma
« on: November 29, 2015, 11:52:30 AM »
Hello,
Indeed some dll's too much,  is SDL Punch and Judy show.

Code: [Select]
include "sdl.inc"
window 320,240,1
cls 0,0,0

sys cList[32]
m = loadmusic "music/xp.mod"
playmusic (m)

sub cycling(sys d,i,f,b)
    if d=1
       t=cList[i]
       for e=i to f-1
           cList[e] = cList[e+1]
       next
       if b=1 then cList[f]=t
    else
       t=cList[f]
       for e=f to i+1 step -1
           cList[e] = cList[e-1]
       next
       if b=1 then cList[i]=t
    endif   
end sub

for i=0 to 15
    cList[i] = RGB(255,(i*16),0)
next
for i=0 to 15
    cList[i+16] = RGB(255,240-(i*16),0)
next

while key(27)=0
cycling(0,0,31,1)
for y=0 to 480
    v = mod(y,32)
    c = cList[v]
    r = getR(c)
    g = getG(c)
    b = getB(c)
    color r,g,b,255
    thickline -1 ,cos(y),320,y,1
    thickline 320,cos(y), -1,y,1
next
redraw
wait 10
wend
winExit

.

JRS

  • Guest
Re: Plasma
« Reply #1 on: November 29, 2015, 12:10:17 PM »
Peter,

You remind me of ground hog day with your examples you post. I have seen the same examples posted here & BP.org at least five times.

How about showing us something new?

Peter

  • Guest
Re: Plasma
« Reply #2 on: November 29, 2015, 12:29:15 PM »
Quote
How about showing us something new?

Lol, is new here in OxygenBasic forum.

Mike Lobanovsky

  • Guest
Re: Plasma
« Reply #3 on: November 29, 2015, 02:47:20 PM »
No DLL hell, pure GDI and Winmm.

Make sure to turn on your MIDI! :)

Code: OxygenBasic
  1. ' !!! FBSL BASIC !!!
  2. #Option Implicit
  3. #Include "mingfx.inc"
  4.  
  5. Dim cList[32]
  6. For i = 0 To 15
  7.   cList[i] = RGB(255, (i * 16), 0)
  8.   cList[i + 16] = RGB(255, 240 - (i * 16), 0)
  9. Next
  10.  
  11. Let(xc, yc, Pen, Angle, Heading) = 0
  12.  
  13. // =============================
  14.  
  15. Width = 600
  16. Height = 600
  17.  
  18. Window(Width, Height, FALSE, "Peter's Gone West!")
  19. Message(100, 250, 14, "Wait while MIDI loads...", 255)
  20. Redraw()
  21.  
  22. LoadMusic("psbgw.mid")
  23. PlayMusic()
  24.  
  25. Animate
  26.   Cycle(0, 0, 31, 1)
  27.   For y = 0 To Height * 2
  28.     v = y Mod 32
  29.     Ink = cList[v]
  30.     DrawLine(-1, Cos(y), Width, y)
  31.     DrawLine(Width, Cos(y), -1, y)
  32.   Next
  33.   Star()
  34.   Redraw()
  35.   Wait(20)
  36. Forever
  37.  
  38. // =============================
  39.  
  40. Sub Cycle(d, i, f, b)
  41.   If d = 1 Then
  42.     t = cList[i]
  43.     For e = i To f - 1
  44.       cList[e] = cList[e + 1]
  45.     Next
  46.     If b = 1 Then cList[f] = t
  47.   Else
  48.     t = cList[f]
  49.     For e = f To i + 1 Step - 1
  50.       cList[e] = cList[e - 1]
  51.     Next
  52.     If b = 1 Then cList[i] = t
  53.   End If
  54. End Sub
  55.  
  56. Sub Star()
  57.   Let(x, y, xc, yc) = 0
  58.   Let r = 400 * Sin(2 * Rad(Angle))
  59.   Let a = r * Sin(Rad(Angle))
  60.   Let b = r * Cos(Rad(Angle))
  61.  
  62.   DrawWidth(10)
  63.   PenStop(): PenUp(): TurnEast(Angle)
  64.   Repeat 7
  65.      GoWest(a): TurnEast(-108.9)
  66.      GoWest(b): TurnEast(-108.9)
  67.      Incr(x, xc)(y, yc)
  68.   End Repeat
  69.   Advance(-x / 7, -y / 7)
  70.   PenStop(): PenDown(): TurnEast(Angle)
  71.   Repeat 7
  72.      Ink(255, 0, 0)
  73.      GoWest(a): TurnEast(-108.9)
  74.      Ink(255, 255, 0)
  75.      GoWest(b): TurnEast(-108.9)
  76.   End Repeat
  77.   Angle = Incr(Angle) Mod 360 // be nice!
  78.   DrawWidth(1)
  79. End Sub
  80.  
  81. // =============================
  82. // In Situ Polar Turtle Graphics
  83. // =============================
  84.  
  85. Macro PenUp()   = Poke(@Pen, FALSE)
  86. Macro PenDown() = Poke(@Pen, TRUE)
  87. Macro PenStop() = Poke(@Heading, 0)
  88.  
  89. Sub Advance(x, y)
  90.   If Pen Then DrawLine(Width / 2 + xc, Height / 2 - yc, Width / 2 + x, Height / 2 - y)
  91.   List(xc, yc) = {x, y}
  92. End Sub
  93.  
  94. Sub TurnEast(degs)
  95.   Heading = Incr(Heading, degs) Mod 360 // ditto!
  96. End Sub
  97.  
  98. Sub GoWest(dist)
  99.   Advance(xc + (dist * Sin(Rad(Heading))), yc + (dist * Cos(Rad(Heading))))
  100. End Sub
  101.  

.

Peter

  • Guest
Re: Plasma
« Reply #4 on: November 29, 2015, 03:43:34 PM »
wonderful, I like it.  8)

JRS

  • Guest
Re: Plasma
« Reply #5 on: November 29, 2015, 05:28:21 PM »
Peter,

Have you tried using FBSL?

Mike supports his BASIC like he would a family member.

OT

I can't believe Chris Boss is still offering fire sales of his EZGUI on the PowerBASIC forum. Seriously, who would invest a penny in an add-on for a compiler that is as dead as its author? Is there anyone here that believes PowerBASIC has a chance of a second life?
« Last Edit: November 29, 2015, 07:51:02 PM by John »

Mike Lobanovsky

  • Guest
Re: Plasma
« Reply #6 on: November 29, 2015, 07:54:49 PM »
Peter doesn't need to. OxygenBasic is freestyle enough as BASICs go. :)

Mike Lobanovsky

  • Guest
Re: Plasma
« Reply #7 on: November 29, 2015, 09:16:56 PM »
OT

Perhaps not exactly a "second" life but a good chance of a "long" life even in its present state of stasis. I continue to go to, and lurk in, the PB Peer Support Forums often as I have always did, for learning the best practices and for inspiration too. IMO the PB community is still the world's second best (after VB6) in terms of intelligence, creativity, and professionalism in the language whose true potential tends to be profaned by artificial reduction to the level of nursery gibberish by certain BASIC "insiders".

JRS

  • Guest
Re: Plasma
« Reply #8 on: November 30, 2015, 01:33:18 PM »
OT

Perhaps not exactly a "second" life but a good chance of a "long" life even in its present state of stasis. I continue to go to, and lurk in, the PB Peer Support Forums often as I have always did, for learning the best practices and for inspiration too. IMO the PB community is still the world's second best (after VB6) in terms of intelligence, creativity, and professionalism in the language whose true potential tends to be profaned by artificial reduction to the level of nursery gibberish by certain BASIC "insiders".

I disagree. PowerBASIC is a fragile patched together 16 bit DOS compiler that generated 32 bit Windows code in the end and a poor job at that. Bob was probably the only person able the create a release build. I don't like speaking bad of the dead that can't defend themselves but it was well known Bob was a cheep bastard that screwed everyone he partnered with. (including me) There are other tidbits I have heard about him that turns my stomach that doesn't deserve repeating. Anyone that still idolizes Bob is a fool and shows what a mindless zombie they have become.


Mike Lobanovsky

  • Guest
Re: Plasma
« Reply #9 on: November 30, 2015, 02:09:32 PM »
OT

I'm not idolizing anybody. I'm simply seeing professional people having hundreds if not thousands of professional PB apps each at their workplaces that need to be upgraded from time to time, who are still making inquiries and paying out solid cash. As always, I'm trying to talk about products and not people behind them. If BZ could have created an 8-bit compiler instead that would be capable of cross compiling solid 64 bit code, so much the better for him because of all the yet lesser work he would have to do to maintain it. It would only characterize him as a yet more skillful programmer. What he did to make ends meet is none of my concern, especially now that he's here no more.

That doesn't however mean that I would team up with him on any project, ever. He was certainly not an easy goer.