Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Marcus

Pages: [1] 2 3 ... 30
1
General discussion / Re: NaaLaa Linux experiments
« on: December 12, 2017 »
I run with 64bit Linux Mint and ran the Robowack executable without any problems. Renamed the executable and recompiled. Ran the new executable without any problems. Very cool.

Am I correct in assuming that there is an IDE available?

J

Thanks for testing :)

I'm working on an IDE. But it will be rather primitive in the first release. Before anything's released, I gotta implement find/replace functions and undo/redo (I realized just now that the standard IUP text control doesn't support that on Linux). Hopefully I can make it work with scintilla later on, and then it'll function better than the Windows version.

You can download the test version I'm sharing with cvirus from here: http://naalaa.com/temp/naalaa001.tar.gz  Just unpack it somewhere and run the install script with "sudo ./install". That will install the IUP runtime libraries required by the editor, NED. The programs you create will not require "anything" to run.
 
I'm using 64bit Linux Mint too. My Windows PC is kind of dead, so ... I'm finally inspired to make the Linux version :D

2
General discussion / NaaLaa game Robowack on Linux
« on: November 30, 2017 »
My full (sparetime) focus is currently on getting naalaa up and running on Linux.

I don't want naalaa to be dependant of other libraries and runtime dummies forcing the programmer and then the end user to install packages and ... stuff. This means, for example, that I've had to write the sound system from "scratch" rather than using audiere, fmod or bass. It's lots of hard work, but I'm getting some good help from cvirus :) The biggest thing left at the moment is writing an IDE, but it probably shouldn't take too long until a beta version will be available.

Attached to this post is my old game Robowack compiled with naalaa for Linux. The compiler is included too, so you could try compiling your own stuff (or programs posted in this forum) if you want to.

If you have a Linux toaster, feel free to report if/how the game and compiler works :)



3
General discussion / Re: > Programming a game contest <
« on: November 23, 2017 »
Sounds like fun, thanks for the link :)  I'm not interested in the money, but I will certainly submit something. 320x200p and 16 colors just makes it more fun, especially for a 3D game :D


4
Code snippets / Trying simple fractals
« on: November 17, 2017 »
I've never tried creating any fractals before, so don't laugh :)  Here are two simple line based ones, will try creating polygon based fractals next:

Code: [Select]
' Some simple fractals.

import "ifx.lib"

visible:
lineCount = 0
hidden:

h = 640
w = h*16/9

set window (screenw() - w)/2, (screenh() - h)/2, w, h
'set window screenw() - w - 32, screenh() - h - 64, w, h
x# = float(width(primary)/2)
y# = float(height(primary))
l# = float(height(primary))*0.26
a# = 270.0

if not IFX_Init() then end

set redraw off
create image 0, width(primary), height(primary)

' A tree fractal.
set image 0
_FractalOne x, y, l, a, 1, 16.0
set color 0, 0, 0
draw rect 0, 0, 256, 32, true
set color 255, 255, 255
set caret 8, 8
wln "Tree fractal: ", lineCount, " lines"
set image primary
_DrawWithGlow 0, 128, 200, 255
redraw
wait keydown

' A line fractal.
set image 0
set color 0, 0, 0; cls
set color 255, 255, 255
lineCount = 0
'_FractalTwo 0.0, float(h/2), float(w), float(h), 16.0
_FractalTwo 0.0, float(h), float(w), float(h), 16.0
set color 0, 0, 0
draw rect 0, 0, 256, 32, true
set color 255, 255, 255
set caret 8, 8
wln "Line fractal: ", lineCount, " lines"
set image primary
set color 0, 0, 0; cls
_DrawWithGlow 0, 255, 64, 8
redraw
wait keydown

procedure DrawWithGlow(img, r, g, b)
set color r, g, b
set additive true
for i = 5 downto 0
draw image img, 0, 0
_IFX_Blur max(i*8, 1)
next
set color 255, 255, 255
draw image img, 0, 0
set additive false
endproc

procedure FractalOne(x#, y#, l#, a#, step, limSqr#)
x2# = x + l*cos(a)
y2# = y + l*sin(a)
dx# = x2 - x
dy# = y2 - y
if dx*dx + dy*dy < limSqr then return
_FractalOne x2, y2, l*0.75, a + 22.5, step + 1, limSqr
_FractalOne x2, y2, l*0.75, a - 45.0, step + 1, limSqr
set color step*12, step*12, step*12
draw line int(x), int(y), int(x2), int(y2)
lineCount = lineCount + 1
endproc

procedure FractalTwo(x1#, y1#, x2#, y2#, limSqr#)
dx# = x2 - x1
dy# = y2 - y1
if dx*dx + dy*dy < limSqr
draw line int(x1), int(y1), int(x2), int(y2)
lineCount = lineCount + 1
return
else
cx1# = x1 + dx*1.0/4.0
cy1# = y1 + dy*1.0/4.0
cx2# = x1 + dx*1.0/2.0
cy2# = y1 + dy*1.0/2.0
draw line int(x1), int(y1), int(cx1), int(cy1)
draw line int(cx2), int(cy2), int(x2), int(y2)
lineCount = lineCount + 2
cx# = dy*0.686
cy# = -dx*0.686

_FractalTwo cx1, cy1, (x1 + x2)*0.5 + cx, (y1 + y2)*0.5 + cy, limSqr
_FractalTwo (x1 + x2)*0.5 + cx, (y1 + y2)*0.5 + cy, cx2, cy2, limSqr
endif
endproc

Sorry for trying to make them look cooler with glow effects, but ... it does the trick.

5
General discussion / Re: NaaLaa Linux experiments
« on: November 10, 2017 »
The issues with polygon drawing and the raycaster failure were caused by the fact that naalaa on Linux is 64 bit instead of 32 (as on Windows). The mixed size of data types caused naalaa's arrays to go ape-shit. So, now naalaa only uses 64 bit types on Linux. Integers are 64 bits and the floating point type is now represented by a 64 bit double instead of a 32 bit float. This means ... that we'll be able to make deeper Mandelbrot zooms :)

If any Linux guy reads this, is a 32 bit version a "must" these days? Not even sure if I can make and test it on my machine.

6
General discussion / Re: NaaLaa Linux experiments
« on: November 08, 2017 »
Nice :D

I made many tests yesterday. The biggest issues left to fix are:

  • There's no sound
  • Drawing polygons doesn't work
  • Raycaster and Mode7 libraries cause really weird output
  • Writing an IDE
  • Big pixel modes work but fullscreen mode doesn't
  • 'create font' doesn't work
  • The extension system doesn't work

Before releasing anything, even a beta thingy, I want to take care of all but the last two issues. I just don't think I can write a TTF to Bitmap font thing under Linux, but I will of course try. I'd rather make 'load font' handle more formats than naalaa's own, so that you can create fonts using Hiero and other bitmap font generators. Making extensions work probably isn't that hard. But re-writing some of the extensions will take lots of time, since they're not cross-platform by nature.


7
General discussion / NaaLaa Linux experiments
« on: November 06, 2017 »
Well, don't get your hopes up quite yet, but I'm finally working on a real Linux port of NaaLaa, with some support from cvirus.

It's working but without sound so far (I haven't decided what to go with there - audiere, free but old, or fmod or bass, not quite free). Extensions will have to wait, so it'll be more like NaaLaa 5 than 6. Hopefully I can upload a test version soon that anyone with a Linux system can try out.


8
Code snippets / Re: Mandala Rock Painting
« on: September 30, 2017 »
Beautiful :)

Thanks for all your programs, Rick. I'll include lots of your stuff in the next update if you don't mind :)

9
Code snippets / Super plasma moving things
« on: September 23, 2017 »
Trying to mimic a screen saver I've seen on mac. Looks like beams, but it's particles following moving cubic Bezier curves.

Code: [Select]
import "ifx.lib"
import "Speed.lib"

constant:
W 800
H 600
HW# 400.0
HH# 300.0

visible:
curves?[6]
particles?[500]

hidden:

randomize 3

create image 1, 31, 31
set image 1
set color 0, 0, 0
cls
for y = 0 to 30;
dy# = float(y - 15)
dysqr# = dy*dy
for x = 0 to 30
dx# = float(x - 15)
d# = sqr(dx*dx + dysqr)
if d < 15.0
c = int(32.0*(1.0 - d/15.0))
set color c, c, c
set pixel x, y
endif
next
next
set image primary


set window (screenw() - W)/2, (screenh() - H)/2, W, H
set redraw off

if not IFX_Init() then end

for i = 0 to sizeof(curves) - 1
_InitCurve curves[i]
next

for i = 0 to sizeof(particles) - 1
particles[i].c = -1
next

tick = 0
do
tick = tick + 1
for i = 0 to sizeof(curves) - 1
_UpdateCurve curves[i]
if tick%6 = i
_AddParticle i
endif
next

last = sizeof(particles) - 1
for i = 0 to last
if particles[i].c >= 0
particles[i].p# = particles[i].p# + 0.00225
if particles[i].p# > 1.0
particles[i].c = -1
endif
endif
next

set color 0, 0, 0, 16; cls
_IFX_Blur 16
_DrawParticles

redraw
_SPD_HoldFrame 60
until keydown(27, true)

procedure InitCurve(&curve?)
curve.x0# = HW
curve.y0# = HH
curve.d1# = 100.0 + float(rnd(300))
curve.a1# = float(rnd(360))
curve.x1# = HW + cos(curve.a1#)*curve.d1#
curve.y1# = HH + sin(curve.a1#)*curve.d1#
curve.s1# = float(rnd(100) - 50)*0.02
curve.d2# = 300.0 + float(rnd(300))
curve.a2# = float(rnd(360))
curve.x2# = HW + cos(curve.a2#)*curve.d2#
curve.y2# = HH + sin(curve.a2#)*curve.d2#
curve.s2# = float(rnd(100) - 50)*0.02
curve.d3# = 300.0 + float(rnd(300))
curve.a3# = float(rnd(360))
curve.x3# = HW + cos(curve.a3#)*curve.d3#
curve.y3# = HH + sin(curve.a3#)*curve.d3#
curve.s3# = float(rnd(100) - 50)*0.02
endproc

procedure UpdateCurve(&curve?)
curve.a1# = curve.a1# + curve.s1#
curve.x1# = HW + cos(curve.a1#)*curve.d1#
curve.y1# = HH + sin(curve.a1#)*curve.d1#
curve.a2# = curve.a2# + curve.s2#
curve.x2# = HW + cos(curve.a2#)*curve.d2#
curve.y2# = HH + sin(curve.a2#)*curve.d2#
curve.a3# = curve.a3# + curve.s3#
curve.x3# = HW + cos(curve.a3#)*curve.d3#
curve.y3# = HH + sin(curve.a3#)*curve.d3#
endproc

procedure EvaluateCurve(&curve?, p#, &x#, &y#)
ip# = 1.0 - p
a# = ip*ip*ip
b# = 3.0*ip*ip*p
c# = 3.0*ip*p*p
d# = p*p*p
x = a*curve.x0# + b*curve.x1# + c*curve.x2# + d*curve.x3#
y = a*curve.y0# + b*curve.y1# + c*curve.y2# + d*curve.y3#
endproc

' debug.
procedure PlotCurve(&curve?, points)
step# = 1.0/float(points)
p# = 0.0
x#; y#
for i = 0 to points - 1
_EvaluateCurve curve, p, x, y
set pixel int(x), int(y)
p = p + step
next
endproc

procedure AddParticle(index)
last = sizeof(particles) -1
for i = 0 to last
if particles[i].c < 0 then break
next
if i <= last
particles[i].c = index
particles[i].p# = 0.0
endif
endproc

procedure DrawParticles()
last = sizeof(particles) - 1
set additive true
for i = 0 to last
if particles[i].c >= 0
alpha = int((1.0 - particles[i].p#)*255.0)
set color 64, 128, 255, alpha
x#; y#
_EvaluateCurve curves[particles[i].c], particles[i].p#, x, y
'draw pixel int(x), int(y)
draw image 1, int(x), int(y)
endif
next
endproc

10
General discussion / Re: Requiring NaaLaa Tutorials
« on: September 08, 2017 »
Yeah, the built in examples and the stuff that you can find on this forum is it, I'm afraid. But if there's anything you want an example of, just make a post and I'll put something together :) Even if you asked something big like "How do I make a Super Mario Bro's clone?", I'd happily respond with code examples quickly :)

Also, most of the games at http://games.naalaa.com come with full sourcecode, but they might be too complex to start with.

11
Libraries / Re: GLOOM, a new raycaster library
« on: August 03, 2017 »
Aye, just set the last parameter for GLOOM_SetFog to 0 :)  Just trying to make it look retro:er with that fog effect.

12
Libraries / Re: GLOOM, a new raycaster library
« on: July 29, 2017 »
Ah, good :)  Usually strafing left and right, by holding down Z, makes distant enemies easier to hit. But I'll add some options for tweaking the controls later. I wanna make 12 levels before I'm done with this game :)

13
Libraries / Re: GLOOM, a new raycaster library
« on: July 28, 2017 »
Here's the first area (four levels) of the game. I've added some music and sound effects, and you can now also use the arrow keys to move (the title screen explains the controls). There's even a boss at the last level, but you still can't die, so ... :)

I forgot to mention on the title screen, that you can HOLD the TAB key to show a map.

14
Yeah, someone reported negative time() values. I guess that could happen if your computer had been turned on for very long. Naalaa only supports signed integers, and as C's timegettime returns a DWORD (an unsigned int) some weird stuff could occur. I've fixed it and it'll be in the next update, that will be released within two weeks (finishing up the GLOOM library).

15
Showcase / Re: Music Keyboard
« on: July 24, 2017 »
I'm going to the No-Internet land for a week, but hopefully I'll be able to download it through my phone, looks interesting!

Pages: [1] 2 3 ... 30