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: 195
» Forum posts: 1,499

Full Statistics

Online Users
There are currently 52 online users.
» 0 Member(s) | 52 Guest(s)

Latest Threads
Backspace Key
Forum: NaaLaa 7 Questions
Last Post: johnno56
1 hour ago
» Replies: 5
» Views: 68
BASIC replicator!
Forum: Everything else
Last Post: 1micha.elok
9 hours ago
» Replies: 1
» Views: 11
BASIC games, Pascal games...
Forum: Everything else
Last Post: luwal
04-23-2025, 02:57 AM
» Replies: 0
» Views: 32
C64 Game Maker v1.5.5
Forum: Programming
Last Post: luwal
04-22-2025, 04:55 AM
» Replies: 0
» Views: 33
City Fighter
Forum: NaaLaa 7 Code
Last Post: 1micha.elok
04-17-2025, 11:37 PM
» Replies: 7
» Views: 550
RW3
Forum: NaaLaa 7 Code
Last Post: Marcus
04-11-2025, 05:22 AM
» Replies: 3
» Views: 357
ugBASIC! Good BASIC!
Forum: Programming
Last Post: luwal
04-04-2025, 11:35 PM
» Replies: 6
» Views: 723
Happy Birthday
Forum: Everything else
Last Post: johnno56
04-03-2025, 10:52 PM
» Replies: 3
» Views: 448
Pool - Cue Sports (Simple...
Forum: NaaLaa 7 Code
Last Post: johnno56
04-03-2025, 06:41 PM
» Replies: 3
» Views: 481
Nintendo Switch 2
Forum: Everything else
Last Post: johnno56
04-03-2025, 05:41 AM
» Replies: 2
» Views: 349

 
  Platforms and ladders
Posted by: Marcus - 01-04-2024, 05:20 PM - Forum: NaaLaa 7 Code - Replies (7)

This is a game that I started working on but abandoned because I didn't feel like drawing more enemy sprites (I even stole and NES:ified the two enemies there are from my n6 game Likker). It comes with a level editor.

[Image: platforms_and_ladders.jpg]



Attached Files
.zip   platforms_and_ladders.zip (Size: 58.9 KB / Downloads: 13)
Print this item

Heart Will NaaLaa generate browser games in the future?
Posted by: luwal - 01-04-2024, 02:11 PM - Forum: Suggestions - Replies (2)

I asked the question because many indie developers(BASIC) want to make browser games. A good example: 5 out of 8 entries are browser games in the jam: https://itch.io/jam/jam-for-all-basic-di...-5/entries

Print this item

  Pong
Posted by: johnno56 - 12-31-2023, 11:31 PM - Forum: NaaLaa 7 Code - Replies (2)

Cast your minds back to before the arrival of Mario when Dinosaurs walked... Sorry. Too far back...
Back when Naalaa 6 reigned supreme... with its Tile Map editor and Raycaster... from the minds of Allan Alcorn and Nolan Bushnell (1972) came the awe-inspiring spectacle that was to be known as "Pong"... made its way to our monitors in all of its monochromatic glory!! The Naalaa 6 version was produced by none other than Marcus (drum roll) Johansson. (see screen grab)

   

... do not forget the original N6 code...

Code:
rem ==================================================================
rem Pong, from basicprogramming.org.
rem
rem By Marcus Johansson.
rem ==================================================================

import "Speed.lib"

set window 0, 0, 320, 240, false, 2
set redraw off

plyX = 8
comX = 320 - 24
comY# = 120.0
comWantedY# = 120.0
comTimer = 25
hasBall = 1
ballX#
ballY#
ballDX#
ballDY#
ballSpeed# = 3.0
comScore = 0
plyScore = 0

do
    plyY = mousey()

    if hasBall = 1
        ballX# = float(plyX + 16)
        ballY# = float(plyY - 4)
        if mousebutton(0)
            ballDX = 1.0
            ballDY = 0.0
            ballSpeed = 2.0
            hasBall = 0
        endif
    elseif hasBall = 2
        ballX = float(comX - 8)
        ballY = comY - 4.0
    else
        ballX = ballX + ballDX*ballSpeed
        ballY = ballY + ballDY*ballSpeed
        if ballY < 0.0
            ballY = 0.0
            ballDY = -ballDY
        elseif ballY# > 240.0 - 8.0
            ballY = 240.0 - 8.0
            ballDY = -ballDY
        endif
       
       
        if ballDX < 0.0
            if RectsOverlap(plyX, plyY - 24, 16, 48, int(ballX), int(ballY), 8, 8)
                dy# = (ballY - float(plyY))/64.0
                dx# = 0.5
                k# = 1.0/sqr(dx*dx + dy*dy)
                ballDX# = k*dx
                ballDY# = k*dy
                ballSpeed = min#(ballSpeed*1.1, 6.0)
            endif
        else
            if RectsOverlap(comX, int(comY) - 24, 16, 48, int(ballX), int(ballY), 8, 8)
                dy# = (ballY - comY)/64.0
                dx# = -0.5
                k# = 1.0/sqr(dx*dx + dy*dy)
                ballDX# = k*dx
                ballDY# = k*dy
                ballSpeed = min#(ballSpeed*1.1, 6.0)
            endif
        endif

        if ballX > 320.0
            hasBall = 1
            plyScore = plyScore + 1
        elseif ballX < -8.0
            hasBall = 2
            comTimer = 50
            comWantedY = float(rnd(240))
            comScore = comScore + 1
        endif
    endif

    comTimer = comTimer - 1
    if comTimer <= 0
        if hasBall = 1
            comWantedY = ballY - 16.0 + float(rnd(32)) + (float(comX) - ballX)/ballSpeed*ballDY
            comTimer = comTimer + 25 + rnd(25)
        elseif hasBall = 2
            hasBall = 0
            ballDX = -1.0
            ballDY = 0.0
            ballSpeed = 2.0
        else
            comWantedY = ballY - 20.0 + float(rnd(40)) + (float(comX) - ballX)/ballSpeed*ballDY
            if ballDX < 0.0
                comTimer = comTimer + 20 + rnd(20)
            else
                comTimer = comTimer + 6 + rnd(6)
            endif
        endif
    endif
    comY = 0.90*comY + 0.1*comWantedY

    set color 0, 0, 0
    cls
    set color 255, 255, 255
    for y = 0 to 29
        draw rect 160 - 2, y*8 + 2, 4, 4, true
    next

    draw rect plyX, plyY - 24, 16, 48, true
    draw rect comX, int(comY) - 24, 16, 48, true
    draw rect int(ballX), int(ballY), 8, 8, true
    set caret 16, 8
    center plyScore
    set caret 320 - 16, 8
    center comScore

    redraw
    proc SPD_HoldFrame(60)   
until keydown(27) or not running()

function RectsOverlap(x0, y0, w0, h0, x1, y1, w1, h1)
    if x0 + w0 < x1 then return false
    if y0 + h0 < y1 then return false
    if x1 + w1 < x0 then return false
    if y1 + h1 < y0 then return false
    return true
endfunc

The following is my N7 version of Pong (based on the N6 version) - not optimized - sorry...


.zip   pong3.zip (Size: 1.72 MB / Downloads: 9)

Print this item

  Space Invaders
Posted by: 1micha.elok - 12-28-2023, 04:31 AM - Forum: NaaLaa 7 Code - Replies (2)

[Image: done.gif]
Let's try it !  [ File : invaders_N7.zip ] ... 
Finally, the Space invaders in Naalaa v7  Big Grin

It's converted from The Tiny Space Invaders written by Marcus in Naalaa v6.



Attached Files
.zip   invaders_N7.zip (Size: 2.9 KB / Downloads: 20)
Print this item

  Xmas New Year
Posted by: johnno56 - 12-23-2023, 06:43 AM - Forum: Suggestions - Replies (17)

I would like to "suggest" that everyone have a great Xmas ahead of an even better New Year.

All the best!

J

Print this item

  Space Race
Posted by: johnno56 - 12-13-2023, 07:20 PM - Forum: NaaLaa 7 Code - Replies (12)

July 16, 1973 saw the release of Atari's, Space Race. Designed by Ted Dabney and assisted by Nolan Bushnell and Allan Alcorn  on the heels of Pong, that released on November 29 of the previous year... 
https://en.wikipedia.org/wiki/Space_Race_(video_game)

This is my feeble attempt to recreated the game... It is not exact and is not complete. Complete in the sense that it is playable.

I have used colour... Sorry. The 'classics' were done in black and white. Like the dinosaurs, black and white, have had their day.

The code is not optimized and may contain 'random features'...

Controls are simple. Player 1 uses "A" and "Z". Player 2 uses "Up" and "Down". (Up and down movement "only").

The game: Both players have a limited amount of time to reach the top of the screen as many times as is possible. Colliding with "objects" will send the player back to the bottom of the screen.

The original game needed quarters to replay... My 7 year-old grand daughter would find the game "boring" but back in 1973... this was the next best thing to magic...

Ideas for improvements will of course be appreciated... but this was just a "fun" project and may not go any further. Mainly a "see if I can" type of game. There is no original source code as the game was purely electronic(?).

It was fun to make...


.n7   spacerace.n7 (Size: 7.6 KB / Downloads: 15)

ps: What were you doing in 1973?

Print this item

  15 Puzzle
Posted by: Asterios - 12-12-2023, 09:17 AM - Forum: NaaLaa 7 Code - No Replies

Hello everyone!

I coded this puzzle to play when I have some idle time.


.zip   15 puzzle.zip (Size: 440.42 KB / Downloads: 11)

Print this item

  Snowflakes
Posted by: Marcus - 12-09-2023, 11:15 AM - Forum: NaaLaa 7 Code - Replies (4)

Here are some spare snowflakes, plenty of them in Sweden!

Something very similar was written in n6 many years ago.

Code:
' Snowflakes
' ----------

include "list.n7"

#win32

constant BG_R = 16, BG_G = 24, BG_B = 64

set window "Snowflakes", 480*screenw()/screenh(), 480, true
set redraw off

snowflakeImage = loadimage("snowflake.png")

stars = List()
for i = 1 to 200  stars.Add([x: rnd()*2 - 1, y: rnd()*2 - 1, z: 0.1 + rnd()*0.9])

set color BG_R, BG_G, BG_B
cls

do
    for i = 0 to stars.size - 1
        s = stars[i]
        s.z = s.z - 0.01
        if s.z < 0.1
            s.z = s.z + 0.9
            s.x = rnd()*2 - 1
            s.y = rnd()*2 - 1
        endif
    next
    stars.Sort(function(a, b)
            return b.z - a.z
        endfunc)
   
    set color BG_R, BG_G, BG_B, 96
    cls
    wp = width(primary)/2
    hp = height(primary)/2
    for i = 0 to stars.size - 1
        s = stars[i]
        x = wp + s.x*wp/s.z*0.75
        y = hp + s.y*hp/s.z*0.75
        size = 16/s.z
        set color BG_R, BG_G, BG_B, s.z*255
        DrawScaledImage(snowflakeImage, x - size/2, y - size/2, size, size)
    next
    fwait 60
    redraw
until keydown(KEY_ESCAPE) or mousebutton(0)

function DrawScaledImage(img, x, y, w, h)
    du = 1/w
    u = 0
    for dx = 0 to w - 1
        draw vraster img, x + dx, y, y + h - 1, u, 0, u, 1
        u = u + du
    next
endfunc



Attached Files
.zip   snowflakes.zip (Size: 7.75 KB / Downloads: 8)
Print this item

  Dino Simplified
Posted by: 1micha.elok - 11-28-2023, 02:27 PM - Forum: NaaLaa 7 Code - No Replies

[Image: images?q=tbn:ANd9GcSGahYamJXIqCJgjZhJzRW...A&usqp=CAU]

Running Dino ( inspired by the Dino in Chrome browser ) in a very very simplified version.
This simplified version is only an animated one.

Here is the structure of the program :
1. Initialization
    -load image : ground
    -load image : dino
2. Main Program (Looping)
    -define ESC key to quit
    -moving background
    -our main character :-) .... the one and only 'Dino'

It still needs improvement on these features that haven't been implemented yet :
- Animated running dino
- Jump over obstacle / cactus
- Avoid a flying bird
- etc.

You are most welcome if you are interested to improve this very simple 'Running Dino'  Big Grin
It's better to start with a simplified version to understand the logic before making it more sophisticated Big Grin

Note : this code below has used 'set redraw off' .... 'redraw' to avoid flickering graphics as it was suggested by Marcus on the '1945 simplified' post / thread.

Code:
'INITIALIZATION
set window "Dino Simplified",640,480
set redraw off 'to avoid flickering graphics
load image 1,"data_dino/ground.png" 'length = 2400 px
load image 2,"data_dino/ground.png"
load image 3,"data_dino/dino1.png"

speed = 10
ground1X = 0    ; ground1Y = 400
ground2X = 2400 ; ground2Y = 400
dinoX    = 40   ; dinoY    = 330

'MAIN PROGRAM
do
   'ESC TO QUIT
    if keydown(KEY_ESCAPE) then end

   'MOVING BACKGROUND
    cls
    draw image 1,ground1X,ground1Y
    draw image 2,ground2X,ground2Y
               
    if ground1X = -2400 then
        ground1X = 0
        ground2X = 2400
    else
        ground1X = ground1X - speed
        ground2X = ground2X - speed       
    endif

    'DINO
    draw image 3,dinoX,dinoY
   
    'WAIT BEFORE LOOPING
    redraw 'to avoid flickering graphics
    wait 40
loop



Attached Files
.zip   dino.zip (Size: 3.77 KB / Downloads: 8)
Print this item

  1945 simplified
Posted by: 1micha.elok - 11-28-2023, 09:17 AM - Forum: NaaLaa 7 Code - Replies (6)

[Image: ?attachment_id=1703]

Air fighter 1945 in a very very simplified version

The main structure of code is divided in two sections :

1. Initialization
    load image : plane
    load image : bullet
    load image : enemy
    load image : background

2. Main Program (Looping)
    Draw the plane
    Define keys : Esc to quit, Left and Right to move the plane
    Draw enemies
    Bullet is auto shoot

Still have miss lots of features  Big Grin ... somebody please add some code to detect collision between a bullet and an enemy, I am running out of idea on how to code collision detect  Sad

Code:
'INITIALIZATION
set window "1945 Simplified", 640, 480
load image 1,"data/plane.png"
load image 2,"data/bullet.png"
load image 3,"data/enemy.png"
load image 4,"data/black.png"

speed=4
planeX=640/2        ; planeY=400
bulletX = planeX+15 ; bulletY = planeY
enemyX = []         ; enemyY = []
enemyX[0] = 40      ; enemyY[0] = -10
enemyX[1] = 300     ; enemyY[1] = -50
enemyX[2] = 400     ; enemyY[2] = -30

'MAIN PROGRAM
do
    'SET BACKGROUND
     cls
     draw image 4,0,0

     'THE PLANE
     draw image 1,planeX,planeY
                       
    'ESC TO QUIT, LEFT AND RIGHT KEYS TO MOVE THE PLANE
     if keydown(KEY_ESCAPE) then end
     if keydown(KEY_LEFT)   then planeX=planeX-speed
     if keydown(KEY_RIGHT)  then planeX=planeX+speed

     'ENEMIES
     for x=0 to 2
        if enemyY[x]>480 then
            enemyX[x]=rnd(640)
            enemyY[x]=-rnd(50)
         else
            enemyY[x]=enemyY[x]+speed
         endif
      next

      for x=0 to 2
        draw image 3,enemyX[x],enemyY[x]
      next
           
     'BULLET, AUTO SHOOT   
      if bulletY < 480 then
        bulletY   =   bulletY - speed*3
      endif
     
      if bulletY = 100 then
        bulletX = planeX+15
        bulletY = planeY
      endif         
                                
      draw image 2,bulletX,bulletY

     'WAIT BEFORE LOOPING
      wait 40
loop



Attached Files
.zip   1945simplified.zip (Size: 16.2 KB / Downloads: 8)
Print this item