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

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 36
» Latest member: bul71
» Forum threads: 169
» Forum posts: 1,360

Full Statistics

Online Users
There are currently 103 online users.
» 0 Member(s) | 101 Guest(s)
Bing, Google

Latest Threads
nPixel
Forum: NaaLaa 7 Code
Last Post: 1micha.elok
7 hours ago
» Replies: 10
» Views: 776
The Shadow Master
Forum: NaaLaa 7 Code
Last Post: 1micha.elok
Yesterday, 07:08 AM
» Replies: 4
» Views: 120
N7 version 25.02.16 relea...
Forum: Announcements
Last Post: 1micha.elok
Yesterday, 01:55 AM
» Replies: 2
» Views: 48
Suggestion: support dynam...
Forum: Suggestions
Last Post: Marcus
02-15-2025, 05:23 PM
» Replies: 8
» Views: 1,053
N7 version 25.02.15 relea...
Forum: Announcements
Last Post: 1micha.elok
02-15-2025, 10:54 AM
» Replies: 1
» Views: 50
Ask help to fix errors (g...
Forum: NaaLaa 7 Questions
Last Post: 1micha.elok
02-15-2025, 09:35 AM
» Replies: 7
» Views: 422
3D Breakout, just a quick...
Forum: NaaLaa 7 Code
Last Post: Marcus
02-02-2025, 07:42 AM
» Replies: 6
» Views: 483
Render on an image before...
Forum: NaaLaa 6 Questions
Last Post: Marcus
01-27-2025, 03:56 PM
» Replies: 4
» Views: 366
Repurposed Sprite Editor
Forum: NaaLaa 7 Code
Last Post: 1micha.elok
01-27-2025, 11:58 AM
» Replies: 13
» Views: 1,067
Alien Breed 3D II: The Ki...
Forum: Everything else
Last Post: Marcus
01-26-2025, 07:58 AM
» Replies: 2
» Views: 310

 
  Fairy Treasure - my "first" PC game
Posted by: Marcus - 03-15-2024, 04:56 PM - Forum: Everything else - Replies (3)

This is not meant as "self promotion" or promotion for the company at which I work. I just thought someone might be interested in a game like this.

I started working at a really small game company back in ... 2006, I think. The first game I was involved with was called Fairy Treasure. I did all the programming, made all the graphics (yes, it's programmer art) and designed many of the levels. Last autumn we decided to port it to a more modern engine (SDL) and release it on Steam. And now it's on sale:

https://store.steampowered.com/app/26010..._Treasure/

It runs on Windows 10 and above and on macOS Smile

Edit This game, or the company, has got nothing to do with naalaa.

Print this item

  n7 version 24.03.10 released
Posted by: Marcus - 03-14-2024, 06:51 PM - Forum: Announcements - Replies (17)

I had planned to release this build, mostly a bug fix, last weekend. But I was in Stockholm, and then I got a really nasty cold which prevented my brain from functioning. If your programs have been crashing while you were trying to use 'draw image xform' or 'draw poly image', this should solve it.

https://naalaa.com/n7/N7_240310.zip

2024-03-10

  • Added an awesome pool game, by Kevin, to examples/other
  • Added the polyline library with some examples
  • Fixed a bug in 'draw image xform', 'draw poly image', 'draw hraster' and 'draw vraster' that could cause a program to crash
  • Fixed a bug where calling 'gc', for forcing garbage collecting, could make some really bad stuff happen

Print this item

  Extended Simple3D version
Posted by: Marcus - 03-08-2024, 02:38 PM - Forum: NaaLaa 6 Questions - Replies (2)

Some years ago, on the old forum that went kabooom, I posted an extended version of the n6 Simple3D library. The posted version let you create and display some primitive 3d shapes (spheres, cubes, cylinders etc) and even load models in the off file format.
   Does anyone have a copy of the library I posted? Lots of code there that I don't want to rewrite for my new experiments ...

Print this item

  Off the air...
Posted by: johnno56 - 03-08-2024, 08:46 AM - Forum: Everything else - Replies (5)

I will be "off the air" from Saturday morning until Monday afternoon. Off on our annual camping break... yah... (not a fan of camping lol) Forecast temperatures for Saturday 39C, Sunday and Monday 38C... The "big three" camping issues... Flies; mosquitoes and Sunburn... I suppose it would be worse if it was hot...

Have a great weekend guys!

J

Print this item

  draw image xform, asteroids example
Posted by: Marcus - 03-07-2024, 05:32 PM - Forum: NaaLaa 7 Code - Replies (6)

This is not a full game, just a player that you can control and some asteroids that fly around. But there are lots of transformed image drawing going on, including the spinning and zooming background image. I'm curious about the fps on your machines? I have a solid 250fps here, but maybe this craptop is a laptop after all.



Attached Files
.zip   asteroids_example.zip (Size: 138.54 KB / Downloads: 10)
Print this item

  Textured polygons helper functions
Posted by: Marcus - 03-06-2024, 03:58 PM - Forum: NaaLaa 7 Code - Replies (1)

'draw poly image' can be hard to use and make sense of, so here is an example program with some helper functions.



Attached Files
.zip   poly_helper.zip (Size: 6.59 KB / Downloads: 8)
Print this item

  N7 logo on email
Posted by: 1micha.elok - 03-06-2024, 01:15 AM - Forum: Suggestions - Replies (1)

Hi, Marcus

I am a fan of Naalaa, you know it  Big Grin
I subcribe and receive email notification of new replies from the Naalaa's forum.
I notice that it is still N6 logo
   
click the image to zoom in

Perhaps ... it is time to change to new N7 logo ...  Cool

.png   logo_N7.png (Size: 8.96 KB / Downloads: 24)
click the image to zoom in

Print this item

  N7 version 24.03.05 released
Posted by: Marcus - 03-05-2024, 07:15 PM - Forum: Announcements - Replies (7)

https://naalaa.com/n7/N7_240305.zip

I haven't experimented with (or even tested, to be honest) the new commands much yet, and the included examples are minimal. But I will provide game examples soon.

Release notes
2024-03-05

  • 'this.' can now be written as just '.'
  • Added the commands 'draw image xform' and 'draw poly image'. You can find two small examples under examples/help: draw_image_xform.n7 and draw_poly_image.n7

'draw image xform' is for drawing transformed (scaled and rotated) images. 'draw poly image' is for drawing texture mapped polygons.

Print this item

  Physics
Posted by: johnno56 - 03-04-2024, 05:50 AM - Forum: NaaLaa 7 Questions - Replies (10)

I cannot recall if I have raised this question before... forgive if I have... What is involved in creating a simple physics engine / library? Say something like Box2D or Box2D-lite? The big question(s)... Can N7 do it... and how?

J

Print this item

  Rotated and scaled image drawing
Posted by: Marcus - 03-03-2024, 10:49 AM - Forum: NaaLaa 7 Code - Replies (27)

I wrote a quick prototype of drawing images with arbitrary rotation and scaling in n7. The code may look a bit too complicated for just drawing a transformed image. But when I add this stuff to the core (implement it in C and add new commands to n7), I will also let you draw textured polygons with any number of points. Here I just draw a textured rectangle, four points.

It's slow, but it's gonna get a lot faster, of course.

I'm already thinking about adding support for z coordinates and perspective correct interpolation (for polygons). Would be fun to allow some 3d rendering as in naalaa 5.

Code:
include "list.n7"

'#win32
#dbg

visible vPoints = fill([x: 0, y: 0, u: 0, v: 0], 4)
visible vXval = List()
vXval.Add([0, 0, 0])
vXval.Add([0, 0, 0])

set window "test", 640, 480
set redraw off

img = loadimage("logo.png")
pln width(img) + ", " + height(img)

a = 0
while not keydown(KEY_ESCAPE, true)
    a = (a + 1)%360
    set color 0, 0, 0
    cls
    set color 255, 255, 255, 0
    ' DrawImageTransformed(image, x, y, scale_x, scaleY, angle, pivot_x, pivot_y)
    ' draw scaled and centered (= pivot at center of image).
    DrawImageTransformed(img, 120, 240, 2, 2, 0, width(img)/2, height(img)/2)
    ' draw rotated and centered
    DrawImageTransformed(img, 320, 240, 1, 1, rad(a), width(img)/2, height(img)/2)
    ' draw rotated and scaled but put pivot at top left corner of image.
    DrawImageTransformed(img, 520, 240, 4, 4, rad(a), 0, 0)
    redraw
    fwait 60   
wend

function DrawImageTransformed(img, drawX, drawY, scaleX, scaleY, angle, pivotX, pivotY)
    srcX = 0
    srcY = 0
    srcW = width(img)
    srcH = height(img)
   
    xLeft = -pivotX*scaleX
    xRight = (srcW - pivotX)*scaleX
    yTop = -pivotY*scaleY
    yBottom = (srcH - pivotY)*scaleY
   
    vPoints[0].x = xLeft; vPoints[0].y = yTop; vPoints[0].u = 0; vPoints[0].v = 0
    vPoints[1].x = xRight; vPoints[1].y = yTop; vPoints[1].u = 1; vPoints[1].v = 0
    vPoints[2].x = xRight; vPoints[2].y = yBottom; vPoints[2].u = 1; vPoints[2].v = 1
    vPoints[3].x = xLeft; vPoints[3].y = yBottom; vPoints[3].u = 0; vPoints[3].v = 1
    for i = 0 to sizeof(vPoints) - 1
        x = vPoints[i].x*cos(angle) - vPoints[i].y*sin(angle)
        y = vPoints[i].y*cos(angle) + vPoints[i].x*sin(angle)
        vPoints[i].x = round(drawX + x)
        vPoints[i].y = round(drawY + y)
        if i = 0
            minX = vPoints[i].x
            maxX = vPoints[i].x
            minY = vPoints[i].y
            maxY = vPoints[i].y
        else
            minX = min(vPoints[i].x, minX)
            maxX = max(vPoints[i].x, maxX)
            minY = min(vPoints[i].y, minY)
            maxY = max(vPoints[i].y, maxY)
        endif
    next   
    if maxX < 0 or minX >= width(primary) or maxY < 0 or minY >= height(primary)  return
    set color 255, 255, 255, 0
    for y = minY to maxY
        numx = 0
        for i = 0 to sizeof(vPoints) - 1
            p0 = vPoints[i]
            p1 = vPoints[(i + 1)%sizeof(vPoints)]
            if p0.y <= y and p1.y > y or
                    p0.y > y and p1.y <= y
                dy = p1.y - p0.y
                if dy = 0
                    vXval[numx][0] = p0.x; vXval[numx][1] = p0.u; vXval[numx][2] = p0.v
                    numx = numx + 1
                    vXval[numx][0] = p1.x; vXval[numx][1] = p1.u; vXval[numx][2] = p1.v
                    numx = numx + 1
                else
                    f = (y - p0.y)/(p1.y - p0.y)
                    vXval[numx][0] = p0.x + f*(p1.x - p0.x)
                    vXval[numx][1] = p0.u + f*(p1.u - p0.u)
                    vXval[numx][2] = p0.v + f*(p1.v - p0.v)
                    numx = numx + 1
                endif
            endif
        next
        if numx
            vXval.size = numx
            vXval.SortByField(0, vXval.ASCENDING)
            for i = 0 to vXval.size - 2 step 2
                draw hraster img, y, vXval[i][0], vXval[i + 1][0],
                        vXval[i][1], vXval[i][2], vXval[i + 1][1], vXval[i + 1][2]
            next
        endif
    next   
   
    draw poly vPoints, false
endfunc



Attached Files
.zip   image_transform.zip (Size: 637.72 KB / Downloads: 12)
Print this item