I actually started writing a game using the tilemap library, and I found a bunch of stuff that didn't work as intended. Here's an updated version of the library where the collision handling works exactly as it did in n5/n6.
Just a bit curious about what games or type of games you're playing. I'm a sucker for single and multiplayer first person shooters. I play most of them on Nintendo Switch, been a Nintendo fan boy since I was a kid and got an NES. I spend way too much of my spare time on playing games, that's for sure
Currently I'm playing Borderlands 2 on the Switch and Team Fortress 2 on PC (I've played that game for almost 6,000 hours in total).
Edit Forgot, I also like horror games, but not the action based ones. Layers of Fear is a good example of what I enjoy playing, story driven with puzzles.
Edit 2 And Minecraft Dungeons. I like Minecraft Dungeons.
I am starting to work on the old Naalaa 'Arkanoid', using your example of 'Breakthrough', and noticed something odd... No. Not an error but odd.
I cannot recall who said it or when, but I recall that Linux has a problem with "creating" fonts...
I was working through the 'Breakthrough' examples and left in the line "Set font createfont... etc" and gave it no thought. The code used 'arial' as the source font. As I said, no thought. The line of code worked. Modified the font size and it worked. Then I had my suspicions... I figured that the reason why 'create font' did not work was because, at the time 'arial' by default, is not a system-wide font. In my case, I had installed all of the MS-core fonts. Tested the theory... This time I installed 'impact' font. Bingo. But then chose a font that I did not have installed ("chiller")... This time the rendered text was a mono-styled font... Installed "chiller" font and it worked...
Just thought I would let you know...
By the way... So far I have modified breakthrough to display the graphics of Arkanoid... Collision detection, on the whole, works fine. 'Bouncing' off a brick corner sometimes does not work, rare, but happens... not a deal breaker. Found it a little annoying that the direction of the ball initially is 'down'. Unless I have the paddle positioned 'just so', when the game starts, the ball goes off screen.
'Off screen'. In one of the later examples you included the TM command to set the borders. As I am still in "example 2", I copied that command, but for some reason it did not work. The 'release' of the border (bottom) worked but the game did not exit. I looked through the later examples but did not see any other command required... no big deal... I just told the game to end if ball.y > height(primary)
Level, Score and Lives are 'hard coded' for reference only...
JSON_FromString/JSON_FromFile would return an array containing two objects with the keys "name", "age" and "hair". And if you used JSON_ToString on that array, it would create a (compact) string with the same content.
' JSON_ToString
' -------------
function JSON_ToString(v)
select typeof(v)
case TYPE_NUMBER
txt = str(v)
case TYPE_STRING
txt = chr(34) + v + chr(34)
case TYPE_TABLE
if key(v, 0)
txt = "["
if sizeof(v)
for i = 0 to sizeof(v) - 1
txt = txt + JSON_ToString(v[i])
if i < sizeof(v) - 1 txt = txt + ","
next
endif
txt = txt + "]"
else
txt = "{"
if sizeof(v)
i = 1
foreach ky, va in v
txt = txt + chr(34) + ky + chr(34) + ":" + JSON_ToString(va)
if i < sizeof(v) txt = txt + ","
i = i + 1
next
endif
txt = txt + "}"
endif
default
txt = "null"
endsel
return txt
endfunc
' JSON_FromFile
' -------------
function JSON_FromFile(filename)
f = openfile(filename)
if not typeof(f) return unset
json = ""
s = frln(f)
while typeof(s)
json = json + s
s = frln(f)
wend
free file f
return JSON_FromString(json)
endfunc
Here's the graphics from an NES style platform game that I released on google play some years ago. Max 3 colors per sprite and 4 colors per tile, obeying the NES limitations regarding number of palettes et.c. I declare it public domain now.
Here's the graphics from an NES style breakout game that I released on google play some years ago. Max 3 colors per sprite and 4 colors per tile, obeying the NES limitations regarding number of palettes et.c. I declare it public domain now.
This is a small "NED" update - the compiler or runtime haven't changed. But it also includes a 5 step tutorial for a breakout:ish game using the tilemap library.
Now you can navigate your source code a bit easier through the function list on the right. Click on a function in the list to jump to its location or hover over it with the mouse cursor to view parameter information in a tooltip.
Release notes
2022-05-12
* Added syntax help to NED
* Added function lists to NED
* Fixed some bugs in the tilemap library
Sloping tiles were not catered for in N6, but Marcus was kind enough to provide a "slope hack" which effectively allowed the use of 45 degree slopes.
Attached is a N7 conversion of this hack. This is a (pretty) straight conversion, and because of this, it makes no use whatsoever of any new features provided in N7. It's here merely to demonstrate how slopes may currently be implemented in N7 tilemap games. Note that if you add sloping tiles, they must have no collision attached, and you may need to change the cell number referenced in lines 86 & 104 to whichever cells you have in your sprite sheet for the sloping tiles.
Thanks to Marcus for the original N6 code and graphics.