Log In  

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

Hi,

I've written a bubble-sort function snippet, which might be helpful for others.

Function takes a list as an argument, and directly modifies that list.

Pico-8 treats the first index as 1 as opposed to 0, so a lot of standard code snippets have to be tweaked to work. Please correct if you see any errors or ways to increase efficiency.

-ElectricGryphon

function bsort(list)
 local i
 local j
 local temp
 local swapped = false

 local n=len(list)

 --problems with 1 based index

 for i=1,n
  do
   swapped = false
   for j=2,n-i+1
     do
     if( list[j]<list[j-1])
      then
       temp=list[j]
       list[j]=list[j-1]
       list[j-1]=temp
       swapped = true
      end
    end
    if(swapped==false)then  return end
  end
end 
1 comment


(Sorry if this post gets a little rant-y!)

My suggestion is for one simple command:

cspr(x1,y1,id1,x2,y2,id2)

mock-up of syntax

My reason:
When I had the idea to port my Gamebuino game, Smash and Crash, I thought this was going to be easy.
I was wrong.
The resolution nor the menus were not a problem, it was collision.
See, the Gamebuino's API had something nice about it: collideBitmapBitmap().
The command checks for two bitmaps, their x and y coordinates, and whether or not a pixel was overlapping.
With this, I was able to make collision very easily implemented.
In PICO-8 however, I find it to be very frustrating.
This is probably coming off as "I can't port my game, so you fix PICO-8 so I can.", isn't it?

Thanks for letting me waste your time(just don't look at it as "wasting").

3 comments


Cart #14718 | 2015-09-28 | Code ▽ | Embed ▽ | No License


Fixed some bugs, changed up the controls, and tweaked the visuals some.

Controls:
Launch Ball: Left Shift
P1 Up: E
P1 Down: D
P2 Up: Up Arrow
P2 Down: Down Arrow

Cart #14689 | 2015-09-28 | Code ▽ | Embed ▽ | No License


Made a simple pong clone and this is my first game ever! Let me know what suggestions you have. Thanks!

1 comment


A rounding-up function doesn't seem to exist for some reason? I tend to use stuff like that for damages, to round to the player, and monster's, favour. I might not have dug far enough, but I couldn't find any built in thing like that.

3
11 comments


Hello Everyone,

The PICO-8 fanzine will be ready to order( for the paper version ) and download for free the 4th of October 2016.

It will contain :

  • illustration by @lucyamorris
  • Game of life( cellular automata) by @dan_sanderson
  • a 3d demo by @NoahRosamilia
  • shrinking your code by @jonstoler
  • how to create a painting tool by @oinariman
  • wave distortion effect by @mattfox12
  • how to do your first state machine by @richterteer
  • a screensaver by @neauoire
  • Color palettes by @gabdar

and the cover has been done by @johanvinet

I'm polishing the layout, and working on the last details.

I really hope you will like it!

8
13 comments




Cart #25047 | 2016-07-10 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
86

Last update : made a better lamp in front of the bike

Here is my first Pico 8 game, it's a "physic" bike game, a bit like the "Trials" series. I tried some experimental "distance field" collision and it work prety well.

  • 7 levels of increassing difficulty
  • 15 collectibles per levels
  • Time clock for speedruns
  • Deathless is possible
  • Deathless with all collectibles is possible but is insanely difficult

Controls :

up = gas
down = brake
left-right = rotate the bike
c to flip bike
v to retry

Old versions :

[ Continue Reading.. ]

86
19 comments


Cart #14634 | 2015-09-26 | Code ▽ | Embed ▽ | No License
9

This is the cartridge for the platformer tutorial I made for fanzine#2. Feel free to ask questions!

9
7 comments


Cart #14595 | 2015-09-24 | Code ▽ | Embed ▽ | No License
10

A crappy little game I did in a month for #1gam. I spent more time on that lousy title screen than I did on the actual game! The result is a hastily designed mess that's mostly based on luck. I intended to have music and sound of course, but there was no time. Gotta meet the deadline you know?

HOW TO PLAY
Your goal is to travel as far to the right as you possibly can. The only mode of transportation in this world is through Bird Taxis. They're expensive. Fortunately, money also grows randomly on this world's sky islands. Hopefully you can find some in your journey to pay up. Otherwise the Bird Taxi will angrily go on strike and plummet to his and your doom. These birds would rather die than to give you a free ride!

Jump on a bird with the up arrow key to start riding it. It will take off if you have some money. Move the bird up or down with the up and down arrow keys. Press X to jump off the bird again. You have to jump off in order to collect more money. Those yellow blocks are supposed to be coins, in case you're wondering. It's money!

Best of luck!

10
9 comments


Cart #14584 | 2015-09-24 | Code ▽ | Embed ▽ | No License
3


This is a song I made up today. I wanted to make something chill, because a lot of chip stuff these days is super uptempo and arpy. Please enjoy! Sorry there is no interactivity.

Feel free to use this in your own games, just let me know about it.

If you like this, I will make more!

3
1 comment


What are some methods to use in order to decrease token amount in the game?

1
2 comments


Hi all.
The following code doesn't work -- players don't get drawn.
What am I doing wrong?
Thanks in advance.
Alex

players = {}

function make_player(col)
  local p = {}
  p.x = 0
  p.y = 0
  p.color = col
  return p
end

function draw_player(p)
  rectfill(p.x-2,p.y-2,p.x+2,p.y+2,p.color)
end

function _init()
  players.home = make_player(1)
  players.visitor = make_player(8)
end

function _draw()
  cls()
  foreach(players, function(p) draw_player(p))
end
6 comments


foo() -- 3 tokens
foo"" -- 2 tokens

when calling an argument where arguments are not used, note this is the same as passing an empty string, not nil!

you can also call a function and pass a single table using

foo{1,2,3,4}
--which is cheaper than
foo({1,2,3,4})

use with care! =)

1
2 comments


Cart #14860 | 2015-10-02 | Code ▽ | Embed ▽ | No License
87


How to play

Go forward in right direction.
Seek a hollow as refuge not to be crushed.
[Z][X]: start/retry game

Release notes

0.61 (Oct 2, 2015)

  • Draw background and so on.

0.50 (Sep 28, 2015)

  • Tune logic of generation of cave.
  • Play music.

0.30 (Sep 24, 2015)

  • Initial Release.

(Older versions)
[hidden]

Cart #14707 | 2015-09-28 | Code ▽ | Embed ▽ | No License
87

Cart #14547 | 2015-09-24 | Code ▽ | Embed ▽ | No License
87

[ Continue Reading.. ]

87
27 comments


Cart #14537 | 2015-09-23 | Code ▽ | Embed ▽ | No License
4

This is the first thing I did in PICO-8. It's not so much a "game" as it is a proof of concept and an attempt to figure out what all this "machine" is capable of with a little inginuity. It...doesn't sound CLEAR, but it kinda sounds like speech, so I'll take that as a success at this point!

4
4 comments


Cart #18754 | 2016-02-09 | Code ▽ | Embed ▽ | No License
4

Dom8verse is a demake of our WIP game Domiverse.
It is a multiplayer arena, one hit “Nooo” game, where aliens with unique skills fight for the domination of the universe.

The pico-8 version only has one character and allow 1v1 versus friend. So it is highly recommended to use joysticks to play the game.

Default inputs:

Player 1:
Move: Arrows
Jump: N
Shoot/reload: M

Player 2:
Move: ESDF
Jump: Left Shift
Shoot/reload: A

We will make updates to add characters and map.

Domiverse website

Changelog:

0.1.1:

  • Fix bug due to pico-8 update

0.1:

  • Initial release

Domiverse website

4
6 comments


Cart #14609 | 2015-09-25 | Code ▽ | Embed ▽ | No License
2

Heart Wars

Use your heart beam to strike your opponent's heart for the win!

Still a work in progress but small changes are on their way!

Player 1 is the orange heart (using E,S,D,F)
Player 2 is the green heart (using the arrow keys)

2
4 comments


I've been hanging out in the IRC channel for a while and it's been really cool to see the community come up around Pico-8. The Fanzine ramped things up by showcasing the cool stuff people have come up with. I haven't made many carts yet but some people expressed interest in what I think makes good code as a professional software developer.

Because of that, I wrote this little series for you guys based off of what I saw in the Fanzine: Clear Code. Some folk in IRC got a kick out of it so hopefully someone here enjoys it as well :)

I also have to say a huge thank you to everyone who contributed to the Fanzine. It takes a certain courage to put your code in public like that so I certainly hope no one minds that I picked some of it apart to make my points.

If you have opinions on code or code snippets to share, post them! I love talking code and Pico-8 brings a lot of interesting developers and ideas together.

3
11 comments


Hi,

Is there a way to make bitwise operations in pico8?
Otherwise, I don't understand how btnwe are supposed to use the bitfields returned by the functions btn() and fget(n).

Shouldn't we be able to do something like :

flag2_set = fget(tile) & 2

I know fget(tile, 2) would work, but I don't see how to use the bitfield. Am I missing something obvious?

1
2 comments


Cart #14490 | 2015-09-22 | Code ▽ | Embed ▽ | No License
3

Here's my Pico8 game 3D Wars.

It's a simple invaders game, with an added anaglyph (red/blue) 3d mode.

The anaglyph mode is very rough and ready. The red/blues aren't quite the correct hue (and as there's no way to hack the palette they just have to do). Also, because there's no blendmode natively available, it relies on persistence of vision to make it work. [ WARNING ] This means it is VERY flickery - if you're in any way sensitive to strobe lighting give the 3d mode a miss!

3
6 comments




Top    Load More Posts ->