New games every week!
Experimenting Blog
6th January 2024
Last night I found myself trying something in JSE and going "Oooh, didn't know it could do that..!"
Which is a bit odd, given that I wrote the thing.

-=-=-

Using SetBuffer BG, you can draw onto the 1024x1024 background layer, but not only that, you can apparently use ReadPixel to read the colours off the background layer, too, which is REALLY interesting!
It means I can "dig" from a background layer, or have other pixel-based elements happen on a mostly-static image.

// New Project // by Jayenkai // Created 2024/1/5 Graphics 320,240,2 GameHandler("New Project","Easy|Normal|Hard") .StartGame px=512 py=512 aimx=px-jscrh/2;aimy=py-jscrh/2 scrx=aimx;scry=aimy SetBuffer BG;ResetDraw SetCol 180,50,0 Rect 0,0,1024,1024 SetBuffer FG Return .InGame // One single frame of your game. aimx=px-jscrw/2;aimy=py-jscrh/2 scrx=SmoothTo(scrx,aimx,8);scry=SmoothTo(scry,aimy,8) CLS:ResetDraw Text 10,10,cx,0 DrawBG 512-scrx,512-scry spd=0.5 gx=(GamePad(ButtonRight)-GamePad(ButtonLeft)) gy=(GamePad(ButtonDown)-GamePad(ButtonUp)) SetBuffer BG R=ReadPixel(Floor(px+gx*6),Floor(py+gy*6),0) if R<50 then spd=2 px=px+gx*spd;py=py+gy*spd if px<8 then px=8 if py<8 then py=8 if px>1015 then px=1015 if py>1015 then py=1015 SetCol 0,0,0 Oval px,py,6,6,16 SetBuffer FG SetCol 0,255,0 Oval px-scrx,py-scry,4,4,16 Return




The above isn't a game, but is a nice example of what I mean. I can imagine a Leiro style game in the engine above, or something of that nature.
Could be interesting to experiment with the possibilities, I reckon!

It's always nice to find unexpected features in programming languages. Especially one you've coded yourself!
..of course, it's also entirely plausible that I coded this feature specifically for that sort of game, and have completely forgotten that I did that!!


"Cartoon Derek, surprise, unexpected, HD, 4K" by #DrawThings

I've missed DrawThings!
Its Greenie's are always much more .. um.. betterrer!
.. You know.. Until it isn't, and you have to replace the tool because the whole model's gone wonky and won't draw properly any more.
Views 34, Upvotes 9  
Daily Blog , Jse
New games every week!
Site credits : Site built from the ground up, in php, using Programmer's Notepad 2, and a very bored Jayenkai.
(c) Jayenkai 2023 and onwards, RSS feed

Blog - Experimenting - AGameAWeek