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

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 35
» Latest member: coronaman
» Forum threads: 141
» Forum posts: 1,194

Full Statistics

Online Users
There are currently 234 online users.
» 1 Member(s) | 232 Guest(s)
Bing, kevin

Latest Threads
Suggestion: support dynam...
Forum: Suggestions
Last Post: oskarg
5 hours ago
» Replies: 5
» Views: 31
Start of a silly Galaga s...
Forum: NaaLaa 7 Code
Last Post: johnno56
12-03-2024, 11:10 AM
» Replies: 9
» Views: 372
Doodle
Forum: NaaLaa 7 Code
Last Post: aurel
11-28-2024, 06:31 PM
» Replies: 7
» Views: 262
How to make a race track ...
Forum: NaaLaa 7 Questions
Last Post: Marcus
11-28-2024, 08:30 AM
» Replies: 10
» Views: 721
An old screenshot
Forum: Everything else
Last Post: Marcus
11-28-2024, 06:13 AM
» Replies: 2
» Views: 107
Arrays and Tables
Forum: Everything else
Last Post: johnno56
11-27-2024, 03:04 AM
» Replies: 4
» Views: 192
Manual
Forum: Everything else
Last Post: johnno56
11-24-2024, 10:13 AM
» Replies: 2
» Views: 135
Xmas New Year
Forum: Suggestions
Last Post: Marcus
11-22-2024, 03:36 PM
» Replies: 17
» Views: 3,519
Santa by Marcus
Forum: NaaLaa 6 Code
Last Post: johnno56
11-18-2024, 05:41 PM
» Replies: 7
» Views: 351
How to code efficiently
Forum: NaaLaa 7 Questions
Last Post: 1micha.elok
11-17-2024, 09:31 AM
» Replies: 4
» Views: 315

 
  Suggestion: support dynamic link library(Raylib)
Posted by: luwal - Yesterday, 03:27 AM - Forum: Suggestions - Replies (5)

Hello...

Please watch this showcase first: https://www.youtube.com/watch?v=GdlGE-eDlzg

Raylib looks popular and many languages can be used with it(also SmallBASIC and FreeBASIC): https://github.com/raysan5/raylib/blob/m...INDINGS.md

Informatiion of Raylib: https://www.raylib.com/

My suggestion: making NaaLaa support dynamic link library.  Then users can use popular game libraries. (Raylib, etc.)

NaaLaa will be much more versatile!!! Shy

Print this item

  An old screenshot
Posted by: Marcus - 11-27-2024, 08:45 PM - Forum: Everything else - Replies (2)

I was checking out an old (2003) webpage of mine using the wayback machine. It mostly contained photos of my son (got him when i was still studying at the university). But there was also a single screenshot of a first person shooter I was working on. I wonder what happened to it?



Attached Files Thumbnail(s)
   
Print this item

  Doodle
Posted by: johnno56 - 11-25-2024, 07:23 PM - Forum: NaaLaa 7 Code - Replies (7)

This is a QB64 converted graphics demo by "Dav". It had no name... figured doodle is better than nothing... lol

Code:
' Open a window and enable double buffering.
set window "Doodle", 640, 640, false
set redraw off

visible i, t, x, y, w, h, pi

pi = 3.141592654
w = 640
h = 640

do
    t = t + 0.01
    set color 0, 0, 0, 25

    draw rect 0, 0, w, h, true
    for i = 1 to 8
        set color i * 32, i * 32 * 0.7, 0, i * 32
        for x = 0 to w
            y = 100 * sin(pi * x / w) * sin(1 * pi * x / w + t + i * t * pi * 0.1)
            draw ellipse x, h / 2 + y, i, i
            draw ellipse w / 2 + y, x, i, i
        next
    next

    redraw
    fwait 30
until keydown(KEY_ESCAPE, true)

Print this item

  Arrays and Tables
Posted by: johnno56 - 11-24-2024, 09:17 PM - Forum: Everything else - Replies (4)

I am familiar with arrays and gradually getting my head around tables... My question may be lame but I need to know... How does one determine whether to use an array or a table?

J

Print this item

  Manual
Posted by: johnno56 - 11-23-2024, 11:11 AM - Forum: Everything else - Replies (2)

Quick question: If there a manual or a list of all of N7's commands with descriptions?

I am fairly certain that I may know the answer... but I need to ask... lol

J

Print this item

  Santa by Marcus
Posted by: johnno56 - 11-16-2024, 04:32 AM - Forum: NaaLaa 6 Code - Replies (7)

Here is a blast from the past (2017)  Almost seasonal... how coincidental... lol


.zip   santa.zip (Size: 3.8 KB / Downloads: 3)

Print this item

  How to code efficiently
Posted by: 1micha.elok - 11-14-2024, 11:02 PM - Forum: NaaLaa 7 Questions - Replies (4)

Hi Marcus,

   
click the image to zoom in

Sometimes, I wonder how you code every game efficiently using min() or max() functions. 
This is a piece of code to animate a Santa Claus :
- cell sprite animation
- move santa from left to the right
- make santa jump up and down

Please advice me how to make the code efficient, perhaps using min() or max() functions ?
Thank you.

Code:
    'santa claus animation
    '----------------------

    'Cell Animation
    draw image santa.run,santa.move,santa.jump,santa.cell
    if santa.cell<11 then
        santa.cell = santa.cell + dt*20
    else
        santa.cell = 0
    endif

    'Running Santa
    if santa.move > 520 then
        santa.move = -50
    else
        santa.move = santa.move + dt*50
    endif

    'Santa Position
    if keydown(KEY_SPACE) then
        santa.pos = 1 'santa position 0=stay 1=up 2=down
    endif
    if santa.pos=1 then
        santa.jump = santa.jump - dt*100
    elseif santa.pos=2 then
        santa.jump = santa.jump + dt*100
    else
        santa.jump = 175
    endif
    if santa.jump <= 80 then
        santa.pos = 2
    elseif santa.jump >= 175 then
        santa.pos = 0
    endif   
Note : the full code is on the attachement.



Attached Files
.zip   Snow2024.zip (Size: 118.43 KB / Downloads: 6)
Print this item

  Start of a silly Galaga style game
Posted by: Marcus - 11-07-2024, 05:38 PM - Forum: NaaLaa 7 Code - Replies (9)

I'm on a one hour train trip so I started writing something in the style of galaga. I won't conitnue working on it, but I'm still posting the code.

Code:
constant ECOLS = 12, EROWS = 8

visible plyImg, enm1Img, enm2Img, enm3Img, enm4Img

set window "Attackers", 256, 224, false, 3
set redraw off

CreateAssets()

randomize 2
enms = dim(ECOLS, EROWS)
for y = 1 to 5  for x = 0 to ECOLS/2 - 1
    if rnd(4) > 0
        select rnd(4)
            case 0
                img = enm1Img
                stm = 1
            case 1
                img = enm2Img
                stm = 2
            case 2
                img = enm3Img
                stm = 3
            default
                img = enm4Img
                stm = 4               
        endsel
        e = [
                img: img,
                a: 0,
                stm: stm,
                pos: Point(0, 0),
                size: Point(14, 14),
                c: fill(Point(0, 0), 4),
                p: unset]
    else
        e = unset
    endif
    enms[x][y] = e
    enms[ECOLS - 1 - x][y] = copy(e)
next

enmsa = 0
divet = 120
tmp = []

enmbullets = []
enmshoott = 180

ply = []
ply.pos = Point(120, 200)
ply.size = Point(16, 16)
ply.spd = 1
plybullets = []

while not keydown(KEY_ESCAPE, true)
    i = 0
    while i < sizeof(plybullets)
        b = plybullets[i]
        b.pos.x = b.pos.x + b.spd.x
        b.pos.y = b.pos.y + b.spd.y
        if b.pos.x < -b.size.x or b.pos.x >= 256 or b.pos.y < -b.size.y or b.pos.y >= 224
            free key plybullets, i           
        else
            hit = false
            for y = EROWS - 1 to 0
                for x = 0 to ECOLS - 1
                    e = enms[x][y]
                    if e and Collides(b, e)
                        e.stm = e.stm - 1
                        if e.stm <= 0  enms[x][y] = unset
                        hit = true
                        break
                    endif
                next
                if hit  break
            next
            if hit  free key plybullets, i
            else  i = i + 1
        endif
    wend
   
    i = 0
    while i < sizeof(enmbullets)
        b = enmbullets[i]
        b.pos.x = b.pos.x + b.spd.x
        b.pos.y = b.pos.y + b.spd.y
        if b.pos.x < -b.size.x or b.pos.x >= 256 or b.pos.y < -b.size.y or b.pos.y >= 224
            free key enmbullets, i           
        else
            i = i + 1
        endif
    wend


    if keydown(KEY_LEFT)  ply.pos.x = max(ply.pos.x - ply.spd, 0)
    if keydown(KEY_RIGHT)  ply.pos.x = min(ply.pos.x + ply.spd, 240)
    if keydown(KEY_SPACE, true)
        plybullets[sizeof(plybullets)] = [
                pos: Point(ply.pos.x + ply.size.x/2 - 1, ply.pos.y - 4),
                size: Point(2, 4),
                spd: Point(0, -4)]
    endif

    divet = divet - 1
    if divet <= 0
        clear tmp
        for y = 0 to EROWS - 1  for x = 0 to ECOLS - 1
            if enms[x][y] and enms[x][y].p = unset  tmp[sizeof(tmp)] = enms[x][y]
        next
        if sizeof(tmp)
            e = tmp[rnd(sizeof(tmp))]
            e.p = 0
            e.c[0].x = e.pos.x; e.c[0].y = e.pos.y
            e.c[1].x = rnd(242); e.c[1].y = 224
            e.c[2].x = rnd(242); e.c[2].y = 224
            e.c[3].x = e.pos.x; e.c[3].y = e.pos.y
            divet = 120 + rnd(3)*60
        else
            divet = 60
        endif
    endif
   
    enmshoott = enmshoott - 1
    if enmshoott < 0
        enmshoott = 180 + rnd(3)*60
        clear tmp
        for y = 0 to EROWS - 1  for x = 0 to ECOLS - 1
            if enms[x][y]  for i = 0 to enms[x][y].p <> unset  tmp[sizeof(tmp)] = enms[x][y]
        next
        if sizeof(tmp)
            e = tmp[rnd(sizeof(tmp))]
            dx = ply.pos.x - e.pos.x
            dy = ply.pos.y - e.pos.y
            k = sqr(dx*dx + dy*dy)
            if k > 0
                dx = 2*dx/k
                dy = 2*dy/k
                enmbullets[sizeof(enmbullets)] = [
                        pos: Point(e.pos.x + e.size.x/2 - 2, e.pos.y + e.size.y/2 - 2),
                        size: Point(4, 4),
                        spd: Point(dx, dy)]
            endif
        endif
    endif

    enmsa = (enmsa + 1)%360
    for y = 0 to EROWS - 1
        offsx = 128 - ECOLS*8 + sin(rad(enmsa + y*22.5))*24
        offsy = 24
        for x = 0 to ECOLS - 1
            e = enms[x][y]
            if e
                gx = x*16 + offsx + 1; gy = y*16 + offsy + 1
                if typeof(e.p)
                    e.p = e.p + 0.005
                    if e.p >= 1
                        e.p = unset
                        e.pos.x = gx; e.pos.y = gy
                    else
                        e.c[3].x = gx; e.c[3].y = gy
                        EvalCBCD(e.pos, e.c, e.p)
                        e.a = atan2(e.pos.y, e.pos.x) - 0.5*PI
                        if e.p < 0.2  e.a = e.a*5*e.p
                        elseif e.p >= 0.8  e.a = e.a*(1 - e.p)/0.2
                        EvalCBC(e.pos, e.c, e.p)
                    endif
                else
                    e.pos.x = gx
                    e.pos.y = gy
                endif
            endif
        next
    next
   
    set color 0, 0, 0
    cls
    set color 255, 255, 255
    for y = 0 to EROWS - 1  for x = 0 to ECOLS - 1
        e = enms[x][y]
        if e and e.p = unset draw image e.img, e.pos.x, e.pos.y
    next
    for y = 0 to EROWS - 1  for x = 0 to ECOLS - 1
        e = enms[x][y]
        if e and typeof(e.p)
            draw image xform e.img, e.pos.x + 7, e.pos.y + 7, 1, 1, e.a, 7, 7
        endif
    next
    draw image plyImg, ply.pos.x, ply.pos.y
    set color 255, 255, 255
    foreach b in plybullets  draw rect b.pos.x, b.pos.y, b.size.x, b.size.y, true
    set color 0, 255, 255
    foreach b in enmbullets  draw rect b.pos.x, b.pos.y, b.size.x, b.size.y, true

    set color 255, 255, 255
    set caret 0, 0
    wln sizeof(plybullets)
    wln sizeof(enmbullets)
   
    redraw
    fwait 60
wend

function Point(x, y)
    return [x: x, y: y]
endfunc

function EvalCBC(dst, curve, param)
    b0 = (1 - param)^3
    b1 = 3*(1 - param)^2*param
    b2 = 3*(1 - param)*param^2
    b3 = param^3
    dst.x = b0*curve[0].x + b1*curve[1].x + b2*curve[2].x + b3*curve[3].x
    dst.y = b0*curve[0].y + b1*curve[1].y + b2*curve[2].y + b3*curve[3].y
endfunc

function EvalCBCD(dst, curve, param)
    b0 = 3*(1 - param)^2
    b1 = 6*(1 - param)*param
    b2 = 3*param^2
    dst.x = b0*(curve[1].x - curve[0].x) + b1*(curve[2].x - curve[1].x) + b2*(curve[3].x - curve[2].x)
    dst.y = b0*(curve[1].y - curve[0].y) + b1*(curve[2].y - curve[1].y) + b2*(curve[3].y - curve[2].y)
endfunc

function Collides(a, b)
    return a.pos.x + a.size.x > b.pos.x and a.pos.x < b.pos.x + b.size.x and
            a.pos.y + a.size.y > b.pos.y and a.pos.y < b.pos.y + b.size.y
endfunc

function CreateAssets()
    plyImg = CreateBitmap(
            [[0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0],
            [0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0],
            [0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0],
            [0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0],
            [0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0],
            [0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0],
            [0, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0],
            [0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0],
            [1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1],
            [1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1],
            [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
            [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
            [1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1],
            [1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1],
            [0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0],
            [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]],
            255, 255, 255)
    enm1Img = CreateBitmap(
            [[0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0],
            [0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0],
            [0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0],
            [0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0],
            [0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0],
            [1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1],
            [1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1],
            [1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1],
            [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0],
            [0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0],
            [0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0],
            [0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0],
            [0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0],
            [0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0]],
            255, 224, 0)
    enm2Img = CreateBitmap(
            [[0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0],
            [1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1],
            [1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1],
            [1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1],
            [1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1],
            [1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1],
            [1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1],
            [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0],
            [0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 0],
            [0, 1, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 1, 0],
            [1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1],
            [1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1],
            [1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1],
            [0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0]],
            255, 96, 0)
    enm3Img = CreateBitmap(
            [[0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0],
            [0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0],
            [0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0],
            [0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0],
            [0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0],
            [0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0],
            [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0],
            [0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0],
            [0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0],
            [1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1],
            [1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1],
            [0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0],
            [0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0],
            [0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0]],
            0, 128, 255)
    enm4Img = CreateBitmap(
            [[0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0],
            [1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1],
            [1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1],
            [1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1],
            [1, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1],
            [1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1],
            [0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0],
            [0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0],
            [0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0],
            [0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 0],
            [0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0],
            [1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1],
            [1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1],
            [0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 0]],
            128, 0, 255)
endfunc

function CreateBitmap(data, r, g, b)
    img = createimage(sizeof(data[0]), sizeof(data))
    set image img
    for y = 0 to sizeof(data) - 1  for x = 0 to sizeof(data[0]) - 1
        set color data[y][x]*r, data[y][x]*g, data[y][x]*b
        set pixel x, y
    next
    set image primary
    set image colorkey img, 0, 0, 0
    return img
endfunc

Print this item

  How to make a race track ?
Posted by: 1micha.elok - 11-06-2024, 02:14 AM - Forum: NaaLaa 7 Questions - Replies (10)

Hi, Marcus,

   
I wonder how to make a race track (see the picture above), could you please advice me ?

This is the code that you made some months ago. 
I believe there are some minor changes with the latest s3d library 

I haven't use it (.... just kidding ...)  Big Grin

Code:
' A library that I'm working on, not finished at all, don't use it!
include "s3d.n7"

#dbg
set window "test", 320, 240, false, 2
set redraw off

roadImg = loadimage("road.png")
roadImgW = width(roadImg)
roadImgH = height(roadImg)
decorImg = loadimage("winter_tree.png")
tunnelImg = loadimage("tunnel_winter.png")
bgImg = loadimage("sky_winter.png")

' Set up 3d view.
S3D_SetView(primary, rad(90), 0.1, 20)
' Render polygons as we add them. If direct mode is false, all polygons are batched, sorted by
' distance and rendered when we call S3D_Render. Here we draw from back to front manually.
S3D_SetDirectMode(true)

road = []
for z = 0 to 999  road[z] = [x: sin(z*0.05)*6, y: sin(z*0.1)*3]

playerz = 0.0
playerx = 0
playery = -1
projected = dim(4) ' Don't want to spawn too many tables in a game loop, reused for calculations.
lastTick = clock()
while not keydown(KEY_ESCAPE, true)
    t = clock()
    dt = (t - lastTick)/1000
    lastTick = t

    playerz = playerz + 4*dt

    ' calculate camera y
    if int(playerz) < sizeof(road) - 2
        k = playerz%1
        playery = (1 - k)*road[int(playerz)].y + k*road[int(playerz) + 1].y - 0.5
    else
        playery = road[sizeof(road) - 1].y - 0.5
    endif
    ' move left and right
    if keydown(KEY_LEFT)  playerx = playerx - 4*dt
    if keydown(KEY_RIGHT) playerx = playerx + 4*dt

    set color 255, 255, 255
    draw image bgImg, 0, -80 - playery*5
   
    S3D_Clear()
    S3D_Translate(-playerx, -playery, -playerz)
    S3D_Begin(S3D_QUADS)
    didFill = false

    strips = 0
    fills = 0

    for i = int(playerz) + 20 to int(playerz)
        if i < sizeof(road) - 2
            strips = strips + 1
            ' Do we need to fill with snow color to hide distant objects?
            S3D_Project(projected, 0, road[i + 1].y, i + 1)
            y0 = round(projected[1])
            S3D_Project(projected, 0, road[i].y, i)
            y1 = round(projected[1])
            if y1 > y0
                if not didFill
                    didFill = true
                    fills = fills + 1
                    set color 218, 218, 218
                    draw rect 0, y0, width(primary), height(primary) - y0, true
                    set color 255, 255, 255
                endif
            else
                didFill = false
            endif

            ' Draw road.
            x0 = road[i].x
            x1 = road[i + 1].x
            set color 255, 255, 255
            S3D_Texture(roadImg)
            S3D_Vertex(x0 - 2, road[i].y, i, 0, roadImgH)
            S3D_Vertex(x0 + 2, road[i].y, i, roadImgW, roadImgH)
            S3D_Vertex(x1 + 2, road[i + 1].y, i + 1, roadImgW, 0)
            S3D_Vertex(x1 - 2, road[i + 1].y, i + 1, 0, 0)
           
            ' Draw sprites.
            ' Fade in.
            z = (i + 1) - playerz
            if z > 15
                a = ((20 - z)/5)*255
                set color 255, 255, 255, a
            endif
            if i%20 = 0
                S3D_Texture(tunnelImg)
                S3D_Vertex(road[i].x - 5, road[i].y + 0.2, i, 0, height(tunnelImg))
                S3D_Vertex(road[i].x + 5, road[i].y + 0.2, i, width(tunnelImg), height(tunnelImg))
                S3D_Vertex(road[i].x + 5, road[i].y - 3.5, i, width(tunnelImg), 0)
                S3D_Vertex(road[i].x - 5, road[i].y - 3.5, i, 0, 0)               
            else
                if i%2 = 0
                    S3D_Texture(decorImg)
                    x = x0 - 2.5               
                    S3D_Vertex(x - 0.4, road[i].y, i, 0, height(decorImg))
                    S3D_Vertex(x + 0.4, road[i].y, i, width(decorImg), height(decorImg))
                    S3D_Vertex(x + 0.4, road[i].y - 1, i, width(decorImg), 0)
                    S3D_Vertex(x - 0.4, road[i].y - 1, i, 0, 0)
                else
                    S3D_Texture(decorImg)
                    x = x0 + 2.5               
                    S3D_Vertex(x - 0.4, road[i].y, i, 0, height(decorImg))
                    S3D_Vertex(x + 0.4, road[i].y, i, width(decorImg), height(decorImg))
                    S3D_Vertex(x + 0.4, road[i].y - 1, i, width(decorImg), 0)
                    S3D_Vertex(x - 0.4, road[i].y - 1, i, 0, 0)
                endif
            endif
        endif
    next
    S3D_End()
    'S3D_Render()
    set caret 0, 0
    wln round(1/dt)
    wln strips
    wln fills
    redraw
    wait 1
wend



Attached Files
.zip   racing_s3d.zip (Size: 303.55 KB / Downloads: 4)
Print this item

  Theme Editor
Posted by: johnno56 - 11-05-2024, 01:12 AM - Forum: Everything else - Replies (2)

I had a few spare moments and decided to have a look at N7 themes... as you know, I run N7 via Wine, on my Linux Mint machine. Although Wine does a fairly good job at running Windows applications, it is far from perfect.

As you can see, by the image provided, Linux Mint "estimates" the font if the correct font is not loaded... I figured that installing Microsoft's core fonts (sudo apt-get install msttcorefonts) would do the trick, but I already have the core fonts installed... The most logical question to ask is, "What fonts does NGUI Theme Editor expect to find on its host system"?

The program itself functions as it should without error... It's just me being a bit "picky" about the "appearance" of the GUI... lol

Thank you.

J

   

Update: Ran Theme Editor via Windows 7 (Virtual Machine) and all the text looks ok...

Print this item