Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 49
» Latest member: bul71
» Forum threads: 36
» Forum posts: 166

Full Statistics

Online Users
There is currently 1 user online
» 0 Member(s) | 1 Guest(s)

Latest Threads
problem with french chara...
Forum: Questions and discussions
Last Post: bul71
04-19-2018, 08:43 PM
» Replies: 0
» Views: 10
Linux version 1.0.1 relea...
Forum: Announcements
Last Post: rentalcarsuae
04-19-2018, 05:31 AM
» Replies: 4
» Views: 601
Rocket Boy
Forum: Showcase
Last Post: Rick3137
04-15-2018, 12:46 AM
» Replies: 8
» Views: 242
How to download All naala...
Forum: Questions and discussions
Last Post: johnno56
04-09-2018, 08:31 PM
» Replies: 3
» Views: 80
MandalaV2
Forum: Showcase
Last Post: Marcus
04-09-2018, 07:08 AM
» Replies: 3
» Views: 111
Drawing an ellipse
Forum: Showcase
Last Post: johnno56
04-06-2018, 05:55 PM
» Replies: 1
» Views: 71
Quick Question
Forum: Questions and discussions
Last Post: Marcus
04-05-2018, 02:38 PM
» Replies: 4
» Views: 121
Avatar
Forum: Questions and discussions
Last Post: johnno56
04-03-2018, 08:20 PM
» Replies: 2
» Views: 95
Error code with min/max a...
Forum: Windows specific
Last Post: kcfb
04-03-2018, 06:39 PM
» Replies: 2
» Views: 106
Version 1.0.3 released
Forum: Announcements
Last Post: johnno56
04-02-2018, 09:25 PM
» Replies: 1
» Views: 116

 
  problem with french characters
Posted by: bul71 - 04-19-2018, 08:43 PM - Forum: Questions and discussions - No Replies

Hi. I'm currently learning Naalaa and it sounds cool to me but I don't know how to display correctly french special characters that come from a file. All these characters diplay propperly when they are directly in the code but not when they come from a file after the open instruction.
Is there anybody with an idea to resolve the problem ?
Thank you.

Print this item

  How to download All naalaa Videos
Posted by: rentalcarsuae - 04-09-2018, 05:34 AM - Forum: Questions and discussions - Replies (3)

Hello Friends 

How can I download All Naalaa YouTube videos and save them on my computer?

How to Download YouTube Videos for Offline Viewing.


Please Help Me...  Huh






Rent a car in Dubai

Print this item

  MandalaV2
Posted by: Rick3137 - 04-06-2018, 08:06 PM - Forum: Showcase - Replies (3)

Here's the drawing program that I have been working on for many weeks.
  It uses the new ellipse command that Marcus made .  (Fast!!)



Attached Files
.zip   MandalaV2.zip (Size: 779.05 KB / Downloads: 5)
Print this item

  Drawing an ellipse
Posted by: Marcus - 04-06-2018, 04:11 PM - Forum: Showcase - Replies (1)

The draw ellipse command is of course written in C. But I first implemented it in naalaa (which is way easier than rebuilding the runtime for every change). Here's the code I was experimenting with, for the fun of it.

The filled version caused some problems. If any pixel was drawn more than once, it wouldn't work with transparency (some areas of the ellipse would be less transparent than others), so I had to draw horizontal and vertical spans depending on the quadrant.

Code:
set redraw off

do
    set color 0, 0, 0, 2
    cls

    set color rnd(256), rnd(256), rnd(256), rnd(256)
    x = rnd(640); y = rnd(480)
    xr = 32 + rnd(64); yr = 32 + rnd(64)
    _FillEllipse x, y, xr, yr

    set color rnd(256), rnd(256), rnd(256), rnd(256)
    x = rnd(640); y = rnd(480)
    xr = 32 + rnd(64); yr = 32 + rnd(64)
    _DrawEllipse x, y, xr, yr

    redraw
    wait 16
until keydown(27, true)

procedure DrawEllipse(cx, cy, xr, yr)
    twoasqr = 2*xr*xr
    twobsqr = 2*yr*yr

    x = xr
    y
    xc = yr*yr*(1 - 2*xr)
    yc = xr*xr
    err
    sx = twobsqr*xr
    sy
    while sx >= sy
        _PlotEllipse cx, cy, x, y
        ADD y 1
        ADD sy twoasqr
        ADD err yc
        ADD yc twoasqr
        if 2*err + xc > 0
            SUB x 1
            SUB sx twobsqr
            ADD err xc
            ADD xc twobsqr
        endif
    wend

    x
    y = yr
    xc = yr*yr
    yc = xr*xr*(1 - 2*yr)
    err
    sx
    sy = twoasqr*yr
    while sx <= sy
        _PlotEllipse cx, cy, x, y
        ADD x 1
        ADD sx twobsqr
        ADD err xc
        ADD xc twobsqr
        if 2*err + yc > 0
            SUB y 1
            SUB sy twoasqr
            ADD err yc
            ADD yc twoasqr
        endif
    wend
   
endproc

procedure PlotEllipse(cx, cy, x, y)
    draw pixel cx + x, cy + y
    draw pixel cx - x, cy + y
    draw pixel cx - x, cy - y
    draw pixel cx + x, cy - y
endproc

procedure FillEllipse(cx, cy, xr, yr)
    twoasqr = 2*xr*xr
    twobsqr = 2*yr*yr

    x = xr
    y
    xc = yr*yr*(1 - 2*xr)
    yc = xr*xr
    err
    sx = twobsqr*xr
    sy
    while sx >= sy
        _FillEllipseH cx, cy, x, y
        ADD y 1
        ADD sy twoasqr
        ADD err yc
        yc = yc + twoasqr
        if 2*err + xc > 0
            SUB x 1
            SUB sx twobsqr
            ADD err xc
            ADD xc twobsqr
        endif
    wend
    h = y - 1

    x
    y = yr
    xc = yr*yr
    yc = xr*xr*(1 - 2*yr)
    err
    sx
    sy = twoasqr*yr
    while sx <= sy
        _FillEllipseV cx, cy, x, y, h
        ADD x 1
        ADD sx twobsqr
        ADD err xc
        ADD xc twobsqr
        if 2*err + yc > 0
            SUB y 1
            SUB sy twoasqr
            ADD err yc
            ADD yc twoasqr
        endif
    wend
endproc

procedure FillEllipseH(cx, cy, x, y)
    draw rect cx - x, cy - y, x*2 + 1, 1, true
    if y <> 0 then draw rect cx - x, cy + y, x*2 + 1, 1, true
endproc

procedure FillEllipseV(cx, cy, x, y, h)
    draw rect cx - x, cy - y, 1, y - h, true
    draw rect cx - x, cy + h + 1, 1, y - h, true
    if x <> 0
        draw rect cx + x, cy - y, 1, y - h, true
        draw rect cx + x, cy + h + 1, 1, y - h, true
    endif
endproc


The code is based on this paper: https://dai.fmph.uniba.sk/upload/0/01/Ellipse.pdf

Print this item

  Quick Question
Posted by: johnno56 - 04-04-2018, 09:52 PM - Forum: Questions and discussions - Replies (4)

What is involved in creating a library for Naalaa? (Ok. I said the question was "quick" but I suspect the answer will not... lol)

J

Print this item

  Avatar
Posted by: johnno56 - 04-02-2018, 09:53 PM - Forum: Questions and discussions - Replies (2)

I tried to update my avatar (128x128px png 1.1k). Didn't work. THEN noticed it should have been 100x100. No problem. Resized and all is well.

Here is the issue.
1. The instructions for changing the avatar stated that if it is too big it will be resized. Initially added the 128x128 image and a blank browser screen just sat there and did nothing. Re-submitted the modified (100x100) image and it update just fine.
2. I tried to make this post with the original image attached and the browser screen went blank and sat there. Tried to "re-send" and the draft posting disappeared.

It's a bit weird. Not a "game changer" but odd. Thought I would point it out...

J

Print this item

  Version 1.0.3 released
Posted by: Marcus - 04-02-2018, 04:11 PM - Forum: Announcements - Replies (1)

I'm terribly sorry for the small and frequent updates. But I found some issues while jumping between Linux (which is my primary platform these days) and Windows.

This fix is for both Linux and Windows:

  • The filled ellipses drawn with draw ellipse now looks much smoother (I noticed some asymmetry)

This is for Windows only:
  • The Keycodes library has been updated with they keys VK_a to VK_z

When using the keydown function to check whether an alphabetical key is being pressed, rather use, for example, VK_a, than "A". This is for platform compatibility reasons. The truth is that keyboard input works much better on Linux than it ever did on Windows. I will make a big overhaul for Windows regarding this soon.


Windows: http://naalaa.com/msi/N6_1_0_3.msi
Linux: http://naalaa.com/release/naalaa6_1.0.3_x86_64.tar.gz

I promise I won't release another update for atleast a month now Smile

Print this item

  Error code with min/max and floats
Posted by: kcfb - 04-02-2018, 12:34 PM - Forum: Windows specific - Replies (2)

Hi, while looking at the Rocketboy code using Windows version 1.0.2, I'm getting the same sort of problem that Rick identified earlier with the "abs" keyword in Arkenoid. 
Specifically "min" in lines 95 & 114, and "max" in line 124 need a "#" added in order to run under Windows. Thanks.

Print this item

  Rocket Boy
Posted by: Marcus - 04-02-2018, 09:30 AM - Forum: Showcase - Replies (8)

I just started writing some code for a game, was thinking about something Defender like but with a boy using a jet pack. But I discovered something weird (atleast on Linux).

You move left and right with the corresponding arrow keys and hold up to use the jet pack. You shoot with spacebar. If I hold left and up (to fly up left) and press spacebar while still holding the other buttons, spacebar doesn't register. Does this happen for anyone else? Is there a difference between Windows and Linux, or is it perhaps a limitation on my keyboard? If I press spacebar first and then up and left, it works as it should.

Sorry for the graphics.



Attached Files
.zip   rocket_boy.zip (Size: 13.16 KB / Downloads: 3)
Print this item

  Windows and Linux version 1.0.2 released
Posted by: Marcus - 04-01-2018, 01:51 PM - Forum: Announcements - Replies (2)

I have now added the draw ellipse command to both the Windows and Linux versions.

Windows: http://naalaa.com/msi/N6_1_0_2.msi
Linux: http://naalaa.com/release/naalaa6_1.0.2_x86_64.tar.gz

The syntax is: draw ellipse center_x, center_y, radius_x, radius_y[, filled]

Example:

Code:
set redraw off
do
 ' Set random color.
 set color rnd(256), rnd(256), rnd(256), rnd(256)
 ' Draw random filled ellipse.
 draw ellipse rnd(640), rnd(480), 16 + rnd(64), 16 + rnd(64), true
 ' Draw random unfilled ellipse.
 draw ellipse rnd(640), rnd(480), 16 + rnd(64), 16 + rnd(64), false
 redraw
 wait 16
until keydown(27, true)

If you want to draw circles, use the same value for radius_x and radius_y.

Print this item