Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Linux difficulties compared to Windows
#1
I, bplus, am newbie to Linux the Mint Cinnamon Distro which is a subset of Ubuntu but with more Windows like appearance if I read my book right.

Anyway I am testing the Battleship app Johnno and I put together, everything is fine until I am halfway through a game with all effects going (mostly just sound files playing) and the thing just ups and quits, no messages, nothing?! When I play without effects it's fine and I can run a whole game to win or lose. I think there were some wav files and possibly those are Windows preferred? But why would they work for awhile and then not? 

Another goofy thing: I am testing a graphics program, a mod of Kens's spiral flower and it just automatically says compiler error see log... I check and it's blank, over and over? I'm thinking there is some invisible character that doesn't show in IDE because I commented out the whole program and still get compiler error message. Weird!

And another thing:
I am testing old Spinners program, that takes a screenshot of desktop and then displays that with spiders crawling all over... oh wait the Wiki did say taking screen shots does not work in Linux, never mind.

Windows has no problem with this, IDE in Linux is happy but the compiler gives me error even when I comment more and more until all of the code:
Code: (Select All)
_Title "b+ Makeover #2 of Ken's Rotating Flower"
Dim image As Long
Screen _NewImage(700, 700, 32)
_ScreenMove 250, 20
For r = 0 To 60 Step .25
    Circle (350, 350), r, _RGB32(255 - r * 4, 0, 0), , , .5 'ovals half width for height
Next
image = _CopyImage(0)
Print " Here is one petal, press any to continue..."
Sleep
For i = 0 To 700
    Line (0, i)-(700, i), _RGB32(0, 160, 255 - i / 700 * 255)
Next
For r = 20 To 0 Step -.25 ' draw a yellow center
    Circle (350, 350), r, &HFFFFFF00
Next
r = 250: zoom = 1
Do ' each loop draws a ring of petals around the center starting on outside
    For a = start To _Pi(2) - .00001 Step _Pi(2 / 30) ' a goes around a circle from 0 to 2*pi = 360 degrees
        x = 350 + r * Cos(a): y = 350 + r * Sin(a) ' here is x, y coordinate for petal center
        angle = _Atan2(350 - y, 350 - x) ' here is the angle of the petal to the center of screen
        RotoZoom x, y, image, zoom, _R2D(angle) ' draw petal centered at x, y, scaled at zoom level, convert angle radians to degrees for rotozoom
        _Display
        _Delay .1
    Next
    zoom = zoom * .75 ' decrease petal scale by 75%
    r = r * .75 '  'next ring of petals decrease radius by 75%
    If r < 20 Then Exit Do ' r is too small we are done!
    toggle = 1 - toggle ' this alters petals so they are offset each time around
    If toggle Then start = -_Pi(1 / 30) Else start = 0 ' offset by half the angle "a" step size
Loop Until InKey$ = Chr$(27)
Sleep

Sub RotoZoom (X As Long, Y As Long, image&, Scale As Single, Rotation As Single)
    Dim px(3) As Single: Dim py(3) As Single
    W& = _Width(image&): H& = _Height(image&)
    px(0) = -W& / 2: py(0) = -H& / 2: px(1) = -W& / 2: py(1) = H& / 2
    px(2) = W& / 2: py(2) = H& / 2: px(3) = W& / 2: py(3) = -H& / 2
    sinr! = Sin(-Rotation / 57.2957795131): cosr! = Cos(-Rotation / 57.2957795131)
    For i& = 0 To 3
        x2& = (px(i&) * cosr! + sinr! * py(i&)) * Scale + X: y2& = (py(i&) * cosr! - px(i&) * sinr!) * Scale + Y
        px(i&) = x2&: py(i&) = y2&
    Next
    _MapTriangle (0, 0)-(0, H& - 1)-(W& - 1, H& - 1), image& To(px(0), py(0))-(px(1), py(1))-(px(2), py(2))
    _MapTriangle (0, 0)-(W& - 1, 0)-(W& - 1, H& - 1), image& To(px(0), py(0))-(px(3), py(3))-(px(2), py(2))
End Sub
Reply
#2
One mystery solved!

Code: (Select All)
_Title "b+ Makeover #2 of Ken's Rotating Flower"

Look at the title, I saved the file under the same name and apparently Linux doesn't like '

I don't think windows is too happy with it either? but it let me compile.

That's why when I commented out all the code, it still wouldn't compile.
b = b + ...
Reply
#3
(04-24-2022, 02:47 AM)bplus Wrote: One mystery solved!

Code: (Select All)
_Title "b+ Makeover #2 of Ken's Rotating Flower"

Look at the title, I saved the file under the same name and apparently Linux doesn't like '

I don't think windows is too happy with it either? but it let me compile.

That's why when I commented out all the code, it still wouldn't compile.

How about: 
Code: (Select All)
_Title "b" + CHR$(43)+ " Makeover " +CHR$(35) + "2 of Ken's Rotating Flower"


Do you mean it won't compile in Linux, or won't save, or both?

Pete
If eggs are brain food, Biden has his scrambled.

Reply
#4
It was saving and acceptable to the IDE but when I went to compile the code in Linux, it rejected the file name. BTW there was no error message in the Log.
b = b + ...
Reply




Users browsing this thread: 1 Guest(s)