Log In  

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

Hi mates,

I'm having some issues with an unexpected (for me) behaviour of rnd() and tostr() functions.

Why this fragment of code prints value 1 if it's supposed that calling rnd() with no arguments produces values from 0 to 0.99999? Does tostr() perform some kind of ceil()?

local rnd_number = rnd()
printh("rnd_number:"..tostr(rnd_number),"maplog.txt")

Output:

rnd_number:0.3293
rnd_number:0.7758
rnd_number:0.5745
rnd_number:0.3691
rnd_number:1
rnd_number:0.0995
rnd_number:0.1682

I need to avoid that '1' value.

5 comments


Cart #thevoid_saturn91_v1_1-0 | 2020-11-24 | Code ▽ | Embed ▽ | No License
4

4
0 comments


Mon premier jeux

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

0 comments


Cart #islandleste999-0 | 2020-11-24 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
6

6
18 comments


Cart #skullshooter-0 | 2020-11-24 | Code ▽ | Embed ▽ | No License
11

Hello!! After several months of work on and off, I am proud to share my first pico-8 game!

This is Skull Shooter, a demake/remake of the very first game I ever programmed in high school. It's a top down shmup with randomized enemies and two powerups.

Arrow keys to move, Z to shoot. Green enemies are worth bonus points, and every 50 points a boss enemy spawns that has more HP than regular enemies.

I used the song "Dimensional Rift" from Pico-8 Tunes Vol. 2 (https://www.lexaloffle.com/bbs/?tid=33675) for the ingame music.

11
2 comments


Cart #holeinone-1 | 2020-11-28 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
18

v1 (11/28/2020)

Updated with 3 new levels, 2 new object types (lock and key), sfx and music! Though I'm not sure if the sfx and music sound good together... I feel like it gets muddied sometimes and there is too much going on in the audio. Feedback is appreciated!

v0 (11/23/2020)

A golf-based puzzle game I am working on! So far there are only 3 levels but I am planning to add many more, including more types of objects. There is currently no music or sfx but I am planning to add those too, eventually.

18
6 comments


Cart #snowcaps-0 | 2020-11-23 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
6

6
1 comment


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

A character and some tiles. Combined basic character and basic tilemap into one.

  • Collisions. The character can only walk on tiles with flag 0. Shout out to doc_robs he taught me mget , fget , and the whole grid system.
  • Before I was drawing the edges myself but not anymore :D
0 comments


Cart #ladderman-1 | 2020-11-22 | Code ▽ | Embed ▽ | No License
9

A little game where you need to build a ladder which is large enough to reach the other side.

9
3 comments


"Testing out Pico-8"

0 comments


Cart #thevoid_saturn91-0 | 2020-11-22 | Code ▽ | Embed ▽ | No License
3

3
3 comments


Cart #celeste_te-0 | 2020-11-22 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
5

A Celeste Template v2

Pls report any bugs cause I was kinda lazy so I didn't look through it while playing so some of it might be buggy

I'm sorry but I cannot post any previous versions for

secret
reasons

5
8 comments


Cart #chrprinter-4 | 2023-07-31 | Code ▽ | Embed ▽ | No License
14

v1.1 -- Added ability to clear output string by pressing Z
v1.2 -- Removed characters 0-15 as Pico-8 0.2.2 made these unusable, tweaked appearance
v1.3 -- Added characters 0-15 as code comments so they can be copied and pasted manually

This is a little tool for easily selecting and outputting characters from Pico 8's extended character set. You can build strings of any length and paste them as text using Ctrl+V or a right mouse click (on the BBS, you have to press Ctrl+C as well). I had some fun making it look like a version of the Pico-8 code editor with text characters as the icons, and since it's a pretty small program, I squeezed it down to fit in a tweet =).

Controls:

[ Continue Reading.. ]

14
6 comments


So, I'm modding a game called Andy the Adventurer and making it into more of a spider man style thing. I want the player to be able to grab onto ledges. I've already made the code for making the player go up by four pixels, but what I need to do is get the coordinates of the nearest instance of a certain sprite. Closest to the player that is. It's the most efficient way to do it I think. I have a sprite specifically for ledge grabbing, and it's invisible. In the map editor, I place it directly next to any steep ledges. So yeah.

TLDR: How do I check the top-left corner location of the nearest instance of a sprite, to the player?
Still long, but better.

EDIT: I suppose a better question would be, how do I check if an x,y coordinate is inside a certain sprite on the map?

2
1 comment


Make some burgers! om nom nom

Cart #burger_creator-0 | 2020-11-21 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
8

How to play:
arrow keys to move cursor
X to add selected ingredient to the burger
O to finish

8
1 comment


Cart #hiyokorun-0 | 2020-11-21 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
1

1
2 comments


Cart #flappycrow-2 | 2020-11-21 | Code ▽ | Embed ▽ | No License
2

2
1 comment


Cart #thechaseupdated-0 | 2020-11-20 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
2

2
2 comments


Cart #celestecside-0 | 2021-09-28 | Code ▽ | Embed ▽ | No License
26

26
18 comments


Cart #mapcompress-2 | 2022-02-27 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
4


new version of mapcompress
use 4x the sprites (kind of)!
this cart serves as a map editor for a new way to draw the map
ESDF to move
left click to place tiles on the map
right click to get a tile from the map
left arrow to toggle x flip
right arrow to toggle y flip
up arrow to toggle sprite selector
z to save map to cart
x to load map/sprites to editor

notice:

  1. currently you cant use sprite flags to draw certain sprites
  2. camera won't work with this, use sx and sy
  3. you cant choose the width/height of the map area you want to draw

map code (put this in your game instead of map()):


function _map(x,y,sx,sy)
local x,y=x or 0,y or 0
local sx=sx or 0
local sy=sy or 0
--local celw=celw or 17
--local celh=celh or 17
--local layer=layer or 0
local mx,my=0,0
for i=0,305 do
local tile=mget(mx+x+(sx\8),my+y+(sy\8))
local tsec=tile\64
local flipx=false
local flipy=false
if(tsec==1 or tsec==3)flipx=true
if(tsec==2 or tsec==3)flipy=true
tile+=(tsec-1)-64
spr(tile,mx
8-(sx%8),my*8-(sy%8),1,1,flipx,flipy)
mx+=1
if mx>17 then
mx=0
my+=1
end
end
end

[ Continue Reading.. ]

4
2 comments




Top    Load More Posts ->