Log In  

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

Cart #26324 | 2016-08-02 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA


Hi!

I'm trying to make a reusable platform game engine in the style of Super Mario Bros or Sonic the Hedgehog etc. I've just finished putting something together and I'd love to get any opinions on how it feels or ways to make it better. The graphics are extremely basic because I'm just focusing on the mechanics for now.

My biggest problem with it is in making jumping through platforms feel nice. Currently if the bottom of the player is intersecting a floor tile, the player is moved above it to stand on it. However this results in the player being put up on a platform when it doesn't feel like he should be. I'd like to make it so that a platform is only detected when the player's feet just slightly intersect it by up to half a tile.

Controls:
Arrow keys to move
"Z" key to jump

Features:
-Horizontal and vertical acceleration
-Friction
-Gravity
-Capped speeds
-Floor detection
-Variable jump height based on length of time button is held
-Variable jump height based on horizontal speed of player at time of jump

It seems to run slower in a browser than in Pico-8. My code isn't currently very efficient, perhaps that's the reason.

9 comments


Cart #26315 | 2016-08-02 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
20

Just got back from Crete, and had a hankering for some PICO-8. Made you all a postcard to get back in the programming groove :).

20
1 comment


Refactor Fun

After reading more of the Pico-8 Zine 2 it's crazy obvious that I should use a "Finite State Machine" to control the hero ship, enemies, etc. I've been looking through the code of the iconic P.A.T. Shooter and it seems a state machine is used to keep track of everything.

It makes sense and it seems to allow for more "portable" functions. As in hey this function is great I can totally use it pretty much as is in a whole other project. Yay, me! Yay, us guys! (at least that's what I want to say)

Using init

The first thing to refactor, I guess, is the global variables declared at the top of the file. They can be blasted into the _init function and everything should work the same:

[ Continue Reading.. ]

2 comments


Cart #26378 | 2016-08-03 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
14

Update:

added function fixstages to TMap class, for prevent unreachable platforms from pattern in stage. Implementation is very simple and you can extend method as you wich. Currently is checked only "platform" tile id.

Method:

From generated POI point is created connection to free edge in stage and remove platform tiles between connected stages if exist.

Cart #26301 | 2016-08-02 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
14

[ Continue Reading.. ]

14
11 comments


When it comes to creating random layouts to a dungeon, does it have to constantly planned out for every eventuality, or can there be a general random pattern algorithm?

2 comments


Cart #26267 | 2016-08-01 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
1

I made this. Download it if you want to. It has music.

1
1 comment


Hi guys,

A snippet out of something I'm tinkering with. My first attempt at tinkering with pico-8 source so excuse if it's a novice question.

EDIT = 1
EDITTEXT = {}
ADD (EDITTEXT,"NO")
ADD (EDITTEXT,"YES")

FUNCTION _UPDATE()
IF (BTNP(5)) THEN EDIT = EDIT + 1 END
IF EDIT > 2 THEN EDIT = 1 END
END

FUNCTION _DRAW()
PRINT("BUTTON(2) - CLEAR:"..EDITTEXT(EDIT),10,20,3)
END

I'd have dumped the whole listing in as a screenshot gif but not really sure how to do that yet. This example should be toggling no or yes when I hit the 2nd fire button but just gives me a syntax error.

I know I should be able to init it with EDITTEXT = {"NO,"YES") or is it (No,Yes) ???

Basically trying to output a string in a collection within a print line.

Thanks.

2 comments


Hi,

I'm trying to put together the physics of a classic platform game in Pico-8. I want to achieve something that behaves like Super Mario Bros.

I have coded a jump system where when the player presses jump, the character rises by a set number of pixels each frame, with that number decreasing every frame, so the character slows down as he gets to the top of his jump. This works well, but I run into problems when I try to implement a variable jump. Like Mario, I'd like my character's jump height to depend on how long the jump button is held down. I did achieve this simply by cancelling the vertical climb when the button is released, but this means that the jump doesn't slow to a halt unless the button is held long enough to see the full jump.

I suspect I'm going about the whole thing in the wrong way and wondered if someone can tell me how the guys at Nintendo did it with Mario. I'm sure there are lots of ways of achieving something similar, but I'd like to know how it was achieved on the NES if possible as I'm as interested in the technique as I am in the end result.

Some Googling suggests that the best method to use is by setting up forces acting on the character. Is this how it would have been accomplished back in the 1980s?

Thanks for any help! :)

Andy

1
6 comments


Cart #26505 | 2016-08-05 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
15

Cart #26285 | 2016-08-01 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
15

Cart #26253 | 2016-08-01 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
15

Quick thing I made with the, ahem, undocumented mouse feature, dunno if it's been done before, but here's my take on a stacking window manager I coded in, like, less than an hour?

  • You can drag and drop windows
  • Active window goes on front
  • Each window has its own update/draw function, clip'd and camera'd to the window

I wanted to post this before going to sleep, but here's what's probably next:

  • Resizing windows
  • Title bars
  • Input to the active window
  • Task bar and desktop icons

Well, hope you like it. It's pretty much a multitasking OS in PICO-8 we have here.

P.S.: Since it uses the undocumented mouse feature, it may or may not work on anything other than the desktop version. You've been warned.

15
16 comments


I've been running through threads trying to find box physics but most of what I find is physics for circles/balls, it seems.

Anybody have a good lead on a physics engine-like thing for squares that I could try to figure out?

My next game idea involves boxes falling to the ground but they need to pile up (and then the player needs to be able to walk/jump on top of them).

I could have the boxes always land on a flat side but thought it would be cooler if they tumble into place and fill in space likes a box would in the real world. Seems like something doable in P8 but I have zero idea on how to start that from scratch, so I need something to get me started.

1 comment


I was dabbling in Npp & ended up making this. It's made navigating through source code much simpler for me, I figured others might find it useful too.

Example from one of Zep's compression carts (whose nested functions caused no end of trouble for my puny regex-fu):

NB, it requires you to edit Notepad's config files, so maybe make a backup first in case something goes wrong.

Link: Github Gist

5
3 comments


Cart #26630 | 2016-08-07 | Code ▽ | Embed ▽ | No License
5


Moving forward with PICO 8
Cart #26225 | 2016-07-31 | Code ▽ | Embed ▽ | No License
5

5
6 comments



8 comments


Hi,
I've made two games in pico-8 until now and because pico-8 is meant to be both a fantasy game system and a development environnement, I wanted to make sure that my code could be read inside the pico-8 editor.
The problem I came across is that lua is highly verbose. That means that writing a simple if else statement takes almost all of the screen width. Since pico-8 already include some shorthands such as += or -=, I though we could have some more to reduce the number of characters used in code. This could be useful for future twitter jam eventually.

so I've read a bit of the lua doc to know which keywords and which tokens are already used:

--used keywords
and       break     do        else      elseif    end
false     for       function  goto      if        in
local     nil       not       or        repeat    return
then      true      until     while

--used tokens
+     -     *     /     %     ^     #
&     ~     |     <<    >>    //
==    ~=    <=    >=    <     >     =
(     )     {     }     [     ]     ::
;     :     ,     .     ..    ...

--token added by pico-8
+=    -=    *=    /=    %=    !=     ?

[ Continue Reading.. ]

5
9 comments


re: Reload/Run/Restart cart: Ctrl+R

Not sure if this is a reported bug, or just something I'm doing wrong, but it appears that CTRL-R is not "Reloading" the file, but rather re-running the current one in memory. (Handy if you use an external editor)

I'm using "pico-8_0.1.8_i386.zip" on a linux system.

1
1 comment


Cart #28133 | 2016-09-07 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
1


Added some sound and effect.
Cart #26197 | 2016-07-31 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
1


My hello world for Pocket C.H.I.P.

1
2 comments


Cart #26194 | 2016-07-31 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
9

Here's a 7500 word dictionary cart for making word games and whatnot. It contains the most common 3-6 letter words according to wiktionary.com, including proper names. The loader is 264 tokens, and the data is 11317, stored over the full map (including shared gfx), plus the last 44 SFX. So there are just 128 sprites and 20 SFX spare. The 5 most common and 10 least common words on the list are:

THE
AND
THAT
WAS
HIS

RADIUM
BAWL
LINTEL
WAFER
WELTER
AUNTY
OPTICS
SIKH
LIL
BARB

Technical details..

The data is generated using a convoluted toolchain process, that I'll post later on if I find time to organize it into something useful.

The compression works by enumerating every possible word in order of word size first, and then alphabetical order. So, A is 0, B is 1, AA is 26, and so on. This means that to store the whole dictionary, only the distances between each word's index is needed. There are many clusters of close words (e.g the distance between CAN and CAP is only 2), so the distances are sorted into range categories depending on how many bits are needed to store each range. Repeated categories are common and so can be encoded with a single bit -- otherwise a 3-bit value is used to store the category for each distance. The encoding utility greedy-searches sets of 5 category bit-lengths and a roman cypher to try to optimize the encoded size, which saved around 1k compared with hand-optimizing the parameter set.

9
4 comments


Cart #26193 | 2016-07-31 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
5

This was made for the 2016 Big Awful Jam, theme: Games for Grandpa

5
3 comments


Got a nice surprise tonight when some friends linked me to PC Gamer where they highlighted BuzzKill and High Climb in their "Free Games of the Week" blog. Very cool...and very cool that folks everywhere are noticing Pico-8 development.

PC Gamer article:
http://www.pcgamer.com/free-games-of-the-week/

Play BuzzKill
https://www.lexaloffle.com/bbs/?tid=3877

Play High Climb
https://www.lexaloffle.com/bbs/?tid=3950

Needless to say, it's the last thing I expected to see for my game...but pretty happy to see it get some attention. And for that I need to thank everyone here for their support in making Pico-8 fun to learn and share.

0 comments


Cart #26269 | 2016-08-01 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
7

Controls
arrows: validate the notes
O + up/down: adjust the synchronization offset
X + up/down: adjust the hi-speed
O + X: hide/show debug

0.2
Small update here :

  • Optimizing the rendering by caching arrows gradients in the spritesheet
  • Added long notes
  • Added combo counter
  • Notes pattern is defined by a multiline string (much like a stepfile)

0.1

Cart #26171 | 2016-07-30 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
7

[ Continue Reading.. ]

7
11 comments




Top    Load More Posts ->