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

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 37
» Latest member: Ludwig
» Forum threads: 203
» Forum posts: 1,543

Full Statistics

Online Users
There are currently 149 online users.
» 0 Member(s) | 147 Guest(s)
Applebot, Yandex

Latest Threads
Backspace Key
Forum: NaaLaa 7 Questions
Last Post: 1micha.elok
8 hours ago
» Replies: 9
» Views: 463
Raylib and SmallBASIC....
Forum: Programming
Last Post: aurel
Today, 08:06 AM
» Replies: 1
» Views: 33
A diligent BASIC dialect(...
Forum: Programming
Last Post: luwal
Yesterday, 11:05 PM
» Replies: 2
» Views: 78
RW3
Forum: NaaLaa 7 Code
Last Post: 1micha.elok
Yesterday, 05:21 AM
» Replies: 6
» Views: 607
It's that time of year ag...
Forum: Everything else
Last Post: 1micha.elok
Yesterday, 05:09 AM
» Replies: 1
» Views: 57
Why all 80's Computers ha...
Forum: Everything else
Last Post: johnno56
05-03-2025, 02:08 PM
» Replies: 3
» Views: 113
The most used BASIC diale...
Forum: Programming
Last Post: johnno56
05-02-2025, 01:01 AM
» Replies: 13
» Views: 520
Most used game engines on...
Forum: Everything else
Last Post: johnno56
05-01-2025, 04:55 AM
» Replies: 1
» Views: 72
Suggestion: other classic...
Forum: Suggestions
Last Post: luwal
04-29-2025, 02:05 AM
» Replies: 2
» Views: 171
Suggestion: an example fo...
Forum: Suggestions
Last Post: luwal
04-27-2025, 06:16 PM
» Replies: 3
» Views: 192

 
  Flappy Bird
Posted by: johnno56 - 04-16-2024, 12:17 PM - Forum: NaaLaa 7 Code - Replies (4)

This is a project I started back on 19th October 2016 using SDLBasic...
Over the years it has been ported to QB64 and RCBasic (Jan 2022)

The game is simple. Left Mouse Button or Space to flap. Fly through the "gaps" in the pipes. Each pipe passed is one point. Warning: The game will speed up gradually (usually after every 5 pipes) to a maximum speed of "8"....


.zip   flappy.zip (Size: 95.22 KB / Downloads: 8)

Be careful... index finger fatigue warning!

(ps: Had to mute the "flapping" sound... so annoying... needs a type of timer mod...)

Print this item

  Pixeli Lander Test
Posted by: johnno56 - 04-15-2024, 12:48 AM - Forum: NaaLaa 7 Code - Replies (5)

Ok. This is a VERY crude Lander test. It uses "pixeli()" for collision with the Landing Pad and normal AABB for the ground...

I would appreciate an examination of how I have implemented the pixeli command and suggest any and all corrections.

Note: The ship can land from beneath the pad... Not an error. The landing pad (except for a concept level) is always on the ground.

The usual controls: Arrow keys.
Note: BOTH landing struts MUST contact the pad.
Watch your landing velocity.


.zip   pixelTest.zip (Size: 70.7 KB / Downloads: 9)

Print this item

  n7 version 24.04.14 released
Posted by: Marcus - 04-14-2024, 10:28 AM - Forum: Announcements - Replies (2)

You can now use 'pixeli(x, y)' or 'pixeli(image_id, x, y)' to get the color of an image's pixel as a single number. You can also use 'set colori' to set the current drawing color using such a number.

If you need to convert RGB or RGBA values to a single number color, you can use functions like these:

Code:
function ToRGB(r, g, b)
    return 255*16777216 + r*65536 + g*256 + b
endfunc

function ToRGBA(r, g, b, a)
    return a*16777216 + r*65536 + g*256 + b
endfunc
 
And to get the RGBA components of a single number color:

Code:
function Alpha(c)
    return int(c/16777216)
endfunc

function Red(c)
    return int((c/65536))%256
endfunc

function Green(c)
    return int((c/256))%256
endfunc

function Blue(c)
    return c%256
endfunc

2024-04-14
Added the 'pixeli' function and 'set colori' command to get and set colors as single numbers

Print this item

  Pixel Color Test
Posted by: johnno56 - 04-11-2024, 08:27 PM - Forum: NaaLaa 7 Questions - Replies (5)

Marcus,

I am still confused in regards to "how" the pixel() command works.

Are you able to explain the output produced? (see attached image)

   

Regards

J

Print this item

  pursuing object
Posted by: aliensoldier - 04-11-2024, 01:51 PM - Forum: NaaLaa 7 Questions - Replies (3)

A question, if I have two objects and one is the player who can move with the keys and the other is the enemy who is stationary in one place on the screen.

The question would be how can I make it so that when the player is close to the enemy he starts chasing the player and if the player moves away the enemy stops chasing him and returns to the starting position.

Print this item

  N6 Lander
Posted by: johnno56 - 04-09-2024, 10:52 PM - Forum: NaaLaa 7 Code - Replies (3)

With all this discussion about Lunar Lander stuff, why not go back to the source, and recreate the original N6 Lander using N7?

Warning: Docking can be a little flaky and keep your eye on that fuel level...


.zip   landerN6.zip (Size: 6.76 KB / Downloads: 6)

ps: Look familiar, Marcus? Wink

Print this item

  The Maze
Posted by: 1micha.elok - 04-09-2024, 09:50 AM - Forum: NaaLaa 7 Code - Replies (15)

THE MAZE
I'm still working on the game, and soon it will be released
Herewith some preview snapshots :

           
click the image to zoom in

Big Grin Big Grin Big Grin

Print this item

  Pixel Collision
Posted by: johnno56 - 04-09-2024, 09:08 AM - Forum: NaaLaa 7 Questions - Replies (11)

I figured that I might try some 'old school' collision detection...

The concept is... A falling box. An area to land on. Using the 'pixel()' command, instruct the box to stop, as it "hits" the ground.

In this example, I am testing the pixel below the box's left bottom edge. (I have placed a reference pixel under the box at the same "y" co-ordinate.)

Press SPACE to drop...

Code:
' Open a window and enable double buffering.
set window "Pixel Collision", 640, 480
set redraw off

visible Box = [255, 255, 0, 64]
visible BoxW = 32
visible BoxH = 48
visible BoxX = (width(primary) - BoxW) / 2
visible BoxY = 0
visible vSpeed = 0
visible drop = false

visible ground = [0, 255, 0]

do

    set color 0, 0, 0
    cls
   
    Update()
    Draw()
   
    redraw
    fwait 30
   
until keydown(KEY_ESCAPE, true)

function Update()
    '   vSpeed
    if keydown(KEY_SPACE, true)     drop = true
    if drop = true  vSpeed = vSpeed + 0.03
   
    '   Box
    BoxY = BoxY + vSpeed
   
    '   Pixel Collision
    if pixel(BoxX, BoxY + BoxH) = ground
        vSpeed = 0
    endif
   
    '   Just in case 'pixel' fails... lol
    if BoxY > height(primary)
        vSpeed = 0
        wait 1000
        end
    endif
endfunc

function Draw()
    '   Ground
    set color ground
    draw rect 0, 460, 640, 20, 0
   
    '   Box
    set color Box
    draw rect BoxX, BoxY, BoxW, BoxH, 0
   
    '   Pixel
   
    '   This indicator pixel is drawn one pixel below the box center.
    '   The actual pixel being tested is below the left corner of the box.
    set color 255, 0, 255
    draw pixel BoxX + 15, BoxY + BoxH
endfunc

Unfortunately this did not work... "Read the manual", I hear you say... "pixel(x,y) Returns the color at position (x, y) as an array [r, g, b, a] with RGBA intensities in the range [0 .. 255].

I am hoping that my programing skills are the source of the problem otherwise this maybe another "can of worms".... sorry...

Print this item

  n7 version 24.04.07 released
Posted by: Marcus - 04-07-2024, 02:13 PM - Forum: Announcements - Replies (10)

I'm taking a break from working on the s3d (simple 3d) library. It's included in this release, and now I want to see if it's possible to make a game using it. It is quite slow now, but I promise you that it will get faster when I implement better ways to do hidden surface removal and optimize all the sloppy code. I wrote some documentation for the library yesterday (S3D.pdf) and there are some examples under n7/examples/s3d_library, but you really need to have some basic knowledge about 3D programming and maybe played around with legacy OpenGL to use this thing. As I mentioned earlier, it's not meant to be a game engine - that comes later.

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

2024-04-07

  • Added the s3d library
  • Hopefully fixed an issue with the tilemap editor when running through wine

Print this item

  Tilemap Editor Linux
Posted by: johnno56 - 04-03-2024, 10:15 PM - Forum: NaaLaa 7 Questions - Replies (15)

I have found a slight problem with the TM on Linux. If you look at the GUI there is a cosmetic difference.

   

The cosmetics do not bother me... The lower 4 radio buttons cannot be selected. At the moment, it is not really an issue, as I seem to be using only the to top 3 buttons. Just to confirm the problem, I ran N7 TM in Windows 7 via Virtualbox (refer to image) and the Win7 version looked fine.

As I am only starting to work my way through the Editor, I am not requiring the use of the "angled" collision detection yet... but you never know.... Moo Ha Ha Ha...

As I stated earlier, I am not concerned about the cosmetic differences, but those lower buttons could end being an issue...

J

Print this item