Zellente [Lexaloffle Blog Feed]https://www.lexaloffle.com/bbs/?uid=102128 Vignette Station <p>Grafics may change but game has left the &quot;alpha phase&quot;, now it needs some copy paste and position arrangment, some rail signals and so on.<br /> There is a menu train, that starts the game, but misses some functionality right now, later you can pick up commuters from the station, but right now this big train just starts the game.</p> <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/102128/from_menu_to_game_0.gif" alt="" /> <h3>Controls</h3> <p>&quot;X&quot; starts the train<br /> Up/Down selects parts of the scene<br /> *there are some indicators as long there is a color border &quot;O&quot; should do something<br /> <table><tr><td> <a href="/bbs/?pid=198884#p"> <img src="/bbs/thumbs/pico8_zellente-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=198884#p"> Vignette Station</a><br><br> by <a href="/bbs/?uid=102128"> Zellente</a> <br><br><br> <a href="/bbs/?pid=198884#p"> [Click to Play]</a> </td></tr></table> </p> <p>A WIP for a vignette game (did not know that this genre exsist, before September 2026. Toy box, Diarama Games)</p> <p>Sept: First upload of a game cart</p> <p>Okt: Big update for me, add a game state and a game start animation.<br /> Okt: No building animation but Tower Cranes and now four rails!<br /> Nov: Lots of code reconstruction. But most parts are ready, just fine tuning for position.</p> <ul> <li>Every game object has its own draw() function, and some sprite data. So I can call game_object:draw_me() and still every object handels his draw part diffreently.</li> <li>There is now a building animation, tower comes from botton of construction side.<br /> <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/102128/alpha_0.gif" alt="" /><img loading="lazy" style="margin-bottom:16px" border=0 src="/media/102128/alpha_1.gif" alt="" /></li> <li>Trains stop outside the screen and start by pressing &quot;O&quot; </li> <li>little blinking animation and tower guy walking</li> </ul> <p>This cart is made for my son (3y) who loves trains and puplic transportation, let&acute;s hope I can finish before he turns 12.</p> <h3>Thanks</h3> <p>Thanks on mjasnowski who opend my eyes for this &quot;function saved inside an object&quot; thing.</p> <p>Thanks on Lazy Devs youtube channel and his<br /> &quot; The 30 Circle Test &quot; and &quot; We Are All Game Beginners - Porklike Postmortem &quot;</p> <h2>Insides</h2> <p>I got this modolo based animation running<br /> runs from zero to number of items in an array </p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre>self.frame = (self.frame+1) % #self.sprite3 end sspr(unpack(self.sprite3[self.frame+1])) self.sprite3={ {16,0, 4,6, 128,rails[3]-4+12, 4,6, false,false}, {16,0, 4,6, 124,rails[3]-4+12, 4,6, true,false},[...] }</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>I love this unpack list combination for spritesheet coords and this rnd use with lists, but do not know if this a common way for little bigger games.</p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre>--( sspr sx,sy, sw,sh, dx, dy, [dw,dh,flip_x,flip_y] ) b={ 0,rnd{8,16,32,40}, 64,8, 0,rails[#rails]-8, 64,8,false,false} sspr(unpack(b))</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>and I love this flip parameter to mimic walking</p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre>for f in all(fahrgastfront) do f[9] = not f[9] --mirror sprite, with sspr[9] flip_x end</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>and this light animation for the houses, where you manipulate the spritesheet.</p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre> for x = 73, 75 do for y = 27, 30 do sset(x, y, c2) end end end</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> https://www.lexaloffle.com/bbs/?tid=160289 https://www.lexaloffle.com/bbs/?tid=160289 Tue, 03 Nov 2026 10:58:22 UTC Help needed with animation loops <p>Hi,<br /> I'm working on some kind of story game, where you start animations with the X/O buttons.<br /> (in the cart, you can use left right to change the animation-loop, index 0 is &quot;idle&quot;, index over 2 crash the game)</p> <h3>My Question is: Is there a common way to do move whole sprites around?</h3> <p>Tutorials I found are all about one sprite animation and not how to how to move the sprite in a loop, instead of players input via buttons. Might not know the search term.</p> <p>I use an array of 8 frames that will manipulated a sspr() command.<br /> The 8. index sets a new sprite-area, after the other frames are used to move the guy around.</p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre>foo bar = {{2,5}, {7,18}, {7,27}, {8,27}, {9,27}, {10,27}, {11,28}, {11,28, 18,80, 4,4, 0,0, 4,4, true,false} } sspr( sx,sy, sw,sh, foobar[1][1],foobar[1][2], [dw,dh,flip_x,flip_y] )) animation_box = { { {2,5}, {7,18}, {7,27}, {8,27}, {9,27}, {10,27}, {11,28}, {11,28, 18,80, 4,4, 0,0, 4,4, true,false} }, { {11,28}, {11,30}, {11,36}, {11,34}, {11,32}, {11,30}, {15,30}, {11,28, 18,80, 4,4, 0,0, 4,4, false,false} } } animation_frame = 0 wm = {1, { 16,80, 2, 4 , 0,0, 2,4,false,false} } p = animation_box[1] animation_frame +=1 wm[2][5],wm[2][6] = p[animation_frame][1], p[animation_frame][2] sspr(unpack(wm))</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p> <table><tr><td> <a href="/bbs/?pid=197331#p"> <img src="/bbs/thumbs/pico8_hifopejdi-1.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=197331#p"> hifopejdi</a><br><br> by <a href="/bbs/?uid=102128"> Zellente</a> <br><br><br> <a href="/bbs/?pid=197331#p"> [Click to Play]</a> </td></tr></table> </p> https://www.lexaloffle.com/bbs/?tid=159659 https://www.lexaloffle.com/bbs/?tid=159659 Sat, 03 Oct 2026 06:51:25 UTC Help with multiple button/keys pressed <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/102128/two_buttons_2.gif" alt="" /> <p>Hi, I try to make a one-button game and thought I could extend it to four players , maybe even using one controller (but yes two players on the direction pad might not work).</p> <p>On a keyboard 4 players could use the keys from both players, even esdf, for movement. Btnp() returns an integer that represents the pressed button/keys. e.g. 512 for player2,-&gt; (right).</p> <p>The players use the x (&quot;x&quot; and o (&quot;c&quot;) buttons and on keybord q,w. I could use btnp(4,0), btnp(5,0) and btnp(4,1),btnp(5,1) but it would use 4 &quot;if-statements&quot; instead of one and I want to use the keyboard and variable keysetting.</p> <p>I would like to have something like this:</p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre>playerbtn = {32,16,4096,8192} player[i] = {btnpressed = playerbtn[i]) for i=1,game.playernumber do if btnp() == player[i].btnpressed then some code end end</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>instead of four times this:</p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre>if btnp(5,0) then if player[1].movment &lt; 8 then player[1].movment += 2 end end</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>but the for-statement doesn't catch all four playerkeys at once, the btnp()-version works with 4 keys pressed simultaneous.</p> <p>What do I miss?</p> <p>(full chart,but WIP, uncoment line 128/141 and comment line 142-182 to test my problem)<br /> <div><div><input type="button" value=" Show " onClick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = ' Hide '; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = ' Show '; }"></div><div><div style="display: none;"><br /> <table><tr><td> <a href="/bbs/?pid=156371#p"> <img src="/bbs/thumbs/pico8_wodijawuju-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=156371#p"> wodijawuju</a><br><br> by <a href="/bbs/?uid=102128"> Zellente</a> <br><br><br> <a href="/bbs/?pid=156371#p"> [Click to Play]</a> </td></tr></table> <br /> </div></div></div></p> https://www.lexaloffle.com/bbs/?tid=144962 https://www.lexaloffle.com/bbs/?tid=144962 Sun, 27 Oct 2024 20:52:01 UTC Can you import a map? <p>Today I finished some code restruction,from scatch and noticed I forgot to &quot;copy&quot; the sprites and the map and no problem<br /> <code>export foo.png //nice</code><br /> <code>export foo.map.png //nice</code><br /> and easy<br /> <code>import foo.png //nice</code> </p> <p>and<br /> <code>import foo.map.png //ups just spritesheet is full</code><br /> ? okay<br /> <code>import map foo.map.png //nope</code></p> <p>Of Course I can just copy the code to the cart with the map I want, but is there a command I didn't found? There are parameter import foobar.png -L, that do not help me.<br /> The Pico-8 manual has only export map...</p> https://www.lexaloffle.com/bbs/?tid=143982 https://www.lexaloffle.com/bbs/?tid=143982 Sun, 01 Sep 2024 08:08:35 UTC