PICO-Tween is a port of the easing functions developed by Robert Penner. This port was based on the Lua port by EmmanuelOgaand optimised to suit the PICO-8 by refactoring to remove unnecessary tokens and making it compatible with the way the PICO-8handles math functions.
Some important things to note:
Despite being optimised, this library as a whole is still huge. It would be in your best interests to grab onlythe functions you plan on using, along with their support functions/variables.
The overall token count for the library is
1556
2083, with an average of around 40-60 tokens per easing function.
This library has had the elastic easing functions removed as they relied on asin and acos, which are notavailable within the PICO-8. My math skills do not extend far enough for me to implement a solution for themthat doesn't rely on those functions.
Thanks to the Nvidea CG Toolkit references, the library now comes with implementations of asin and acos. This meansthat elastic easings have been reincluded and should be working as intended.
An important thing to note is that in order for the sine easings to work correctly, I've used the radian basedconversion for the base sin and cos functions without the y inversion:
cos1 = cos function cos(angle) return cos1(angle/(3.1415*2)) end
sin1 = sin function sin(angle) return sin1(-angle/(3.1415*2)) end
If you rely on sin and cos within your game and don't want to use radian based angles, then you'll need to adapt yourinput to the easing function accordingly to perform these calculations manually.
Alongside this library, I've also released an extension library to act as a support for this. It's a lightweight wrapperto help drive and manage all tween objects and related code in order to reduce boilerplate and mess, as well as simplifythe process of creating and using tweens.
You can view the repository here: PICO-TweenMachine.
Like any PICO-8 library, integrating this library into your cart is as simple as copy/pasting the sourceinto the top of your code (I recommend the top in order to avoid problems with object ordering).
If you only need a small number of easing functions and are planning on using them individually, be sure tocheck for their dependencies. For example, there is a definition of Pi at the top of the library that might need to becopied over, along with radian based sin and cos function redefinitions used within the sine easing functions.
Any of these functions should be simple to just plug in and play, provided you have a basic knowledge of how to useeasing functions.
Here is a basic example of using the linear function to move across the screen:
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
You should get the following results:
You can find a test cart that allows you to cycle through all of the easing functions in the cart folderif you want to load it up into the console and play around with it!
Here are some example gifs:
This library port wouldn't have been possible without the original easings functions by Robert Penner.
It also wouldn't have been anywhere near as easy without the Lua port for the functions by EmmanuelOga
PICO-EC aims to provide very basic and simple support for Scenes, Entities and Components within PICO-8. The library offers a simple solution to creating custom objects with init, update and draw cycl
Pico 是一个相当简单的 CMS 系统,甚至不提供管理的后台程序。直接在线编辑内容。无需数据库支持,直接使用文件存储,因此速度巨块。支持 Markdown 格式和 twig 模板。 License: Open source Server Language: PHP 5.2.4+ Database: No. Flat file CMS. Self-Hosted: Yes Support Plugins/Extensions: Yes
Pico 是一个全功能的 J2ME 和 Symbian 手机的开发套件,提供的包括 Web 浏览、电子邮件以及短信彩信等功能,包含的组件有:PicoMail, PicoWeb, 和 PicoSMS 。
Awesome PICO-8 A curated list of PICO-8 resources, tutorials, tools and more. Inspired by the awesome list thing. You might also like awesome-lua and awesome-love2d. PICO-8 is a fantasy console for ma
面试时间:08/25 面试形式:视频会议 面试岗位:后端开发 一面(45min) 面试官介绍 自我介绍 面试官介绍本次面试流程:算法+基础+项目+反问环节 算法 两两交换链表中的节点(ACM 模式) 基础知识 os: 进程和线程的区别? 进程间通信方式? linux命令: 查看CPU状态? 查看网络情况? 查看磁盘大小? 如何查看大小前5的大文件? 计网: URL背后的过程? DNS解析详细说一下
一面5月31日 二面6月6号 1.自我介绍 2.项目 3.八股文: mysql数据库 去重,聚合关键词 java 垃圾回收机制,文件操作io 深拷贝与浅拷贝 七层模型 多线程与多进程 字符流与字节流 为什么tcp释放连接是四次挥手 不是三次 输入一个url后会怎么样 一些常见linux命令 点赞测试 支付页面测试 为什么做测试 职业规划 4.做题 一道简单mysql查询 左连接 算法:括号匹配