Log In  
Follow
PixcelDev

To all of you users maintaining public Github repositories of either your games or supporting libraries for other PICO-8 users, I've just put up a repository containing PICO-8 badges.

This way you can add a Made With PICO-8 badge to your readme, alongside any other repo related badges you generally use!

Show your support for the tool and enjoy!

Link: https://github.com/JoebRogers/MadeWithPICO-8Badges

3
1 comment



Cart #52473 | 2018-05-07 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
2

The demo cart for my tweening/easings library PICO-Tween.

You can see the thread for the library here: https://www.lexaloffle.com/bbs/?tid=31241

Alternately you can view the repository here: https://github.com/JoebRogers/PICO-Tween


The cart just demonstrates all the available easing functions provided with the library (all easing functions from the traditional Robert Penner easing libraries are ported).

Left Arrow and Right Arrow to cycle through the different easings.

Enjoy!

2
1 comment



Hey all!

I've recently worked on a couple of different libraries for the PICO-8, which are available on Github. I've posted them around on the subreddit and Discord server to good responses, however have held back from posting here until now!

So without further adieu..

PICO-Tween - Repository

PICO-Tween is a port of the easing functions developed by Robert Penner. This port was based on the Lua port by EmmanuelOga and optimised to suit the PICO-8 by refactoring to remove unnecessary tokens and making it compatible with the way the PICO-8 handles math functions.

It comes packaged with some various sourced and ported additional math functions to make some things work, such as asin and acos.

It comes with a pretty hefty token count if using every tween, at 2083 tokens, however on average each easing function is only around 40-60 tokens so can just be picked out and slotted in where appropriate along with any math dependencies.

It should come pretty easy to use, if you have any experience with tweens, particularly of the Penner variety, in any other language or framework. Here's a small code example that you can paste directly into a cart to see how to get set up with something basic like linear tween:

function linear(t, b, c, d)
  return c * t / d + b
end

local distance = 50
local duration = 1

function downFunc(v)
  return linear(v, 0, distance, duration)
end

function upFunc(v)
  return linear(v, distance, -distance, duration)
end

local easeProp = 0
local timeElapsed = 0
local currentFunc = downFunc
local lastTime = time()
local dt = 0

function _update()
  t = time()
  dt = t - lastTime
  lastTime = t
  timeElapsed += dt

  if timeElapsed > duration then
    timeElapsed = 0
    if currentFunc == downFunc then currentFunc = upFunc else currentFunc = downFunc end
  end

  easeProp = currentFunc(timeElapsed)
end

function _draw()
  rectfill(0, 0, 128, 128, 3)
  circfill(64, 40 + easeProp, 20, 15)
end

[ Continue Reading.. ]

1
0 comments