Log In  

BBS > Superblog
Posts: All | Following    GIFs: All | Postcarts    Off-site: Accounts

This function uses bresenham's algorithm mirrored to the 8 octants, filtered by angle for the desired arc angles. It's so slow as to be useless; there are much better arc functions on the BBS already. I'm posting it for posterity and future reference, and because it inspired me to come up with a handy octant-range asin() approximation that might actually be useful

-- approximation of asin(d) for 0<=d<=.7071
-- exact at d==0, d==sin(1/16), d==sin(1/8)
-- max error .0021 at d==sin(3/32) in given range
-- error within that max beyond bounds up to d==sin(.137)
function delta2angle(d)
 return d * 0x.29cf + (d > 0x.61f8 and (d - 0x.61f8) * 0x.0785 or 0)
end

function arc(x, y, r, a1, a2, ...)
 a1 %= 1
 a2 %= 1
 if (a1 == a2) pset(x + r * cos(a1), y - r * sin(a1), ...) return
 a2 = a2 + (a1 > a2 and 1 or 0) -- ensure a2>a1
 dx, dy = r, 0
 while dy <= dx do
  a = delta2angle(dy / r)
  for flip_x = -1, 1, 2 do
   for flip_y = -1, 1, 2 do

[ [size=16][color=#ffaabb] [ Continue Reading.. ] [/color][/size] ](/bbs/?pid=73025#p)
0 comments


Cart #gipuwesuno-0 | 2020-02-12 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
2

We were fiddling with another project and realized that, because we were using sspr() to resize images, we didn't actually know where all the pixels were - and we wanted to know, because we wanted to cast a shadow that was the colors of what was below but in shadow. And we realized that PICO-8 lets you look at the screen in the code, and then the concept of green screen popped into our head, and then we got to work.

It's not minimized and it's not optimized - if you tell it to chromakey the whole screen, it'll chew through the entire CPU budget with change (ask us how we know!) - but I think it's readable enough that people can hack on it. We haven't tested it extensively, but we made sure it respected the current clipping rectangle and restored it before it exited, because that seemed like the correct thing to do.

[ Continue Reading.. ]

2
8 comments


 x,y,w,h=64-10.75,64-10.25,20.5,20.5
 rectfill(x,y,x+w-1,y+h-1,8)
 clip(x,y,w,h)
 rectfill(x,y,x+w-1,y+h-1,11)
 circ(64,64,12,12)

Note that on the top and left the circle extends to the edge of the rect, as is expected since the rect was drawn to match the impending clip region. Note the extra row on the bottom, inside the original rectfill, outside the clipping rectangle.

I think this is a bug. At the very least, it's a place where the documentation needs to be clarified.

(the circle being off center is irrelevant)

1
1 comment


I find after I look away from the editor, after using it for a while, I will have a blue bar shape burned into my retina.

I've used the config.txt gui settings but they seem to only change the body of the editor and not the bars at the top and the bottom.

1
1 comment


Just wrote my first app that allows to draw like Jackson Pollock by using arrow keys and z/x keys to change the color from predefined palette.

Cart #pico_pollock-0 | 2020-02-11 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

0 comments


Sometimes your cartridge fits in the token count, but not the characters count / compressed size, so you can't export it until you reduce the number of characters in the cartridge. You'd also like to keep comments, meaningful variable names and even debug code where you can, in case you're gonna continue working on the code.

One way to do this is to use a build pipeline:

  • copy your source file(s) to an intermediate directory
  • process file(s) to reduce code size
  • output final cartridge

If you use picotool or work with compiled languages, you should be familiar with that process. It may sound a bit overkill for PICO-8, but is very useful if you're stuck in the case mentioned above.

This is what I do when working with my custom framework pico-boots, but while I don't think many devs would be interested in using a complete framework for PICO-8 written by somebody else, they may be interested in the individual processing steps described below. You can always refer to pico-boots' repository for implementation details.

[ Continue Reading.. ]

1
5 comments


To see what's been done in Applecart so far, go HERE:

https://www.lexaloffle.com/bbs/?tid=36727

This was supposed to be posted Sunday but I get detained, so here it is Monday. Better late than never, right ? :)

Continuing the Applecart we were going to do five stages of the Apple puzzle game, PENSATE.

  1. Sprites and game appearance (due now, I finished mine all in just an hour)
  2. Movement of sprites and player (due 02-09-20)
  3. Menus and scoring (etc)
  4. Sound
  5. Cleanup and completion

For more information about this cart, go HERE:
https://www.lexaloffle.com/bbs/?tid=36727

You should have already completed numbers 1 and 2 over this 2-week period. Here is a video of my version of current PENSATE for Pico-8 based on the original game for the Apple ][.

As you can see like the original you get a chance to choose where to place the player at the bottom for your first move and after that, at least for the first few levels, you get one move for yourself and one move for your opponents.

[ Continue Reading.. ]

1
0 comments


M5Stack FACES ESP32 Pocket Computer

https://www.adafruit.com/product/4176?gclid=CjwKCAiA-P7xBRAvEiwAow-VaVF8nwJYDM9EHOmuvnOdwONOOiSYwTeGQZM03KKQhDL4jdfMQxcioRoC-T4QAvD_BwE

Do you guys think pico8 could run on this? I have been looking for a device I could program and run pico8 on and the idea of being able to code, then swap the face out seems pretty cool. It's like having a tiny dev computer that turns into the console afterwords.

1
1 comment


Cart #nuhupapera-1 | 2020-02-15 | Code ▽ | Embed ▽ | No License
3


Explore a bunch of squarish islands, dig up some treasure, leave your footprints!

Experimenting with noise map generation combined with auto-tiling.

Controls:
Arrow keys to move
Z to dig/skip map generator animation
X to show mini-map

Uses @Felice's Noise Map Generator.

3
2 comments


Cart #dragondot3-4 | 2022-09-20 | Code ▽ | Embed ▽ | No License
106

Be a dragon! Lay waste to your foes with your claws, bite, and fire breath! Gather gold and bring it back to your lair to grow in power! Bask in the adoration of your kobold followers! (Also you're a circle for some reason. This is Dragondot 3, you should be used to that by now.)

An action-adventure game full of secrets to find and new abilities to gain, drawing inspiration from the Legend of Zelda series among others. Map exploration, skills gained, and hoard stockpiled are all saved persistently, so you can continue your adventure across multiple sessions. Featuring over twenty different types of creatures to encounter, over twenty different skills to acquire (some with multiple upgrade levels), over a hundred map screens to explore (not even counting the dungeons, tunnels, and secret caves!) -- all packed into a single cozy little pico-8 cartridge.

[ Continue Reading.. ]

106
33 comments


Cart #wepackmofa-0 | 2020-02-08 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
1

1
0 comments



Swerve around enemies and connect lines to boost your score! Connect long lines to become invincible, but be careful, new enemies are always coming!

5
1 comment


Im not sure what is wrong, but whenever I press Z it never shoots

TAB 0

function _init()
init_objects()

-- set up craft
px=63
py=100
pspr=1
vx=0
thrust=0.1
f=0.97
t_spr=17

-- set up stars
map1y=0
map2y=0
map3y=0
map1_spd=1
map2_spd=0.5
map3_spd=0.25
map_height=128
end

function _update()
--scroll map
map1y+=map1_spd
map2y+=map2_spd
map3y+=map3_spd
if map1y>127 then map1y=0 end
if map2y>127 then map2y=0 end
if map3y>127 then map3y=0 end

-- get input and change sprite
-- and thrust
pspr=1
if btn(0) then
vx-=thrust
pspr=3
end
if btn(1) then
vx+=thrust
pspr=2
end

-- apply thrust and friction
vx*=f
px+=vx

--check edges
if px<0 then
px=0
vx=0
end
if px>120 then
px=120
vx=0
end

-- change thrust sprite
t_spr+=1
if t_spr>19 then t_spr=17 end

--fire bullet
if btn(2) then
add_new_bullet(px,py,0,-3)
end

--draw bullet
for b in all(bullets) do
b:update()
end

end

function _draw()
cls()

-- draw stars
map(0,0,0,map1y,16,16)
map(16,0,0,map2y,16,16)
map(32,0,0,map3y,16,16)
map(0,0,0,map1y-map_height,16,16)
map(16,0,0,map2y-map_height,16,16)
map(32,0,0,map3y-map_height,16,16)

spr(pspr,px,py)
spr(t_spr,px,py+8)

--draw bullet
print(#bullets,1,2)
for b in all(bullets) do

b:draw()
end

end

TAB 1

--objects

function init_objects()
--declare objects
bullets={}

end

function add_new_bullet(_x,_y,_dx,_dy)
add(bullets,{
x=_x,
y=_y,
dx=_dx,
dy=_dy,
life=20,
draw=function(self)
circfill(self.x,self.y,2,11)
end,
update=function(self)
self.x=self.dx
self.y=self.dy
self.life-=1
if self.live<0 then
del(bullets,self)
end
end
})
end

3 comments


As I'm working rather deeply in coding for the next Sorcery project, I am running into a nasty little thing that when the screen scrolls it jumps back when the cursor is able.

@zep: Suggest using CTRL [ and CTRL ] to shift the viewpoint of the source-code to center it if need be and reset to zero when ENTER is hit.

And before you think my tabs big they are not. I use 2-spaces per indentation so this can visually be a problem with complex and deep level nesting.

11 comments


Cart #spaz48_fox-1 | 2020-02-07 | Code ▽ | Embed ▽ | No License
12

So, here's the main thing I've been working on since I posted VVVVVV Moonfall. I've been a lot more relaxed with it, and I've been taking measures to not write total spaghetti code, and some of it's even commented. In all, I'm really proud of how this has been coming together. The camera needs work, as does some little aspects of the movement, and some things need tweaking, but I'll get to all of that eventually.

For now, I've decided to post this mainly because I'm kind of exhausted creatively, and don't really know where to go next. So I'm gonna be taking a break from it, and probably from Pico-8 too. (making carts, at least.) I've been spending almost all of my free time lately on it, and I feel like that's kind of been sucking the life out of me, among other things. Anyway, enough about me.

[ Continue Reading.. ]

12
9 comments


!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
This is an older work-in-progress version! Play the completed released version here.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Cart #mot_ramps-14 | 2020-05-25 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
30

This is a little scaled-sprite 3D graphics engine inspired by the old classic game Power Drift.
Still work in progress. Needs some basic game-play rules (laps, win/lose etc) and some difficulty balancing. But it's playable.

[ Continue Reading.. ]

30
18 comments


Cart #xavieriscool-1 | 2020-02-07 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
2

2
1 comment


Cart #tetriswip-2 | 2020-02-07 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
2

Hello there!

I'm making a Tetris clone that uses the map to save tile data. The program draws the tetraminoes using 2 'for' loops and a table that has start and center information, but also how many columns and rows to draw in this config:
table_x={startx,starty, row1x,row1y,n row1, row2x,row2y,n row2}

The program is supposed to check if it has a second row:
if(table[6]!=nil) then
pos_x,pos_y=0,0
for n=1,table[8],1 do
rot_x,rot_y=rot(table[6]+pos_x,table[7]+pos_y)
for v=0,7,7 do
for b=0,7,7 do
if(op=="gravity") then
flag=fget(mget((p1.x+rot_x+b)/8,(p1.y+rot_y+v)/8),0)
if(flag) then
....

[ Continue Reading.. ]

1
8 comments


Cart #tetriswip-2 | 2020-02-07 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
2

2
0 comments


Is it possible to make carts private? It could help developers to make multicart games, the secondary carts could be private

2
2 comments




Top    Load More Posts ->