Git Product home page Git Product logo

nesbox / tic-80 Goto Github PK

View Code? Open in Web Editor NEW
4.8K 121.0 454.0 124.74 MB

TIC-80 is a fantasy computer for making, playing and sharing tiny games.

Home Page: https://tic80.com

License: MIT License

C 80.63% C++ 2.98% Makefile 0.21% Java 9.26% HTML 0.38% Objective-C 0.06% CMake 2.58% Shell 0.06% Lua 1.57% JavaScript 0.17% Dockerfile 0.09% Ruby 0.08% Zig 0.80% D 0.24% Rust 0.89%
tic80 retro gamedev gameengine tiny 8bit tic-80 fantasy-console fantasy-computer

tic-80's Introduction

Build Status

TIC-80 TIC-80 TINY COMPUTER - https://tic80.com

About

TIC-80 is a free and open source fantasy computer for making, playing and sharing tiny games.

With TIC-80 you get built-in tools for development: code, sprites, maps, sound editors and the command line, which is enough to create a mini retro game.

Games are packaged into a cartridge file, which can be easily distributed. TIC-80 works on all popular platforms. This means your cartridge can be played in any device.

To make a retro styled game, the whole process of creation and execution takes place under some technical limitations: 240x136 pixel display, 16 color palette, 256 8x8 color sprites, 4 channel sound, etc.

TIC-80

Features

  • Multiple programming languages: Lua, Moonscript, Javascript, Ruby, Wren, Fennel, Squirrel, Janet, and Python.
  • Games can have mouse and keyboard as input
  • Games can have up to 4 controllers as input (with up to 8 buttons, each)
  • Built-in editors: for code, sprites, world maps, sound effects and music
  • An additional memory bank: load different assets from your cartridge while your game is executing
  • Moderated community

Binary Downloads

You can download compiled versions for the major operating systems directly from our releases page.

Nightly builds

Can be downloaded from nightly builds page or from the Github Actions page.

Pro Version

To help support TIC-80 development, we have a PRO Version.

This version has a few additional features and binaries can only be downloaded on our Itch.io page.

For users who can't spend the money, we made it easy to build the pro version from the source code: (cmake .. -DBUILD_PRO=On)

Pro features

  • Save/load cartridges in text format, and create your game in any editor you want, also useful for version control systems.
  • Even more memory banks: instead of having only 1 memory bank you have 8.
  • Export your game without editors, and then publish it to app stores.

Community

You can play and share games, tools and music at https://tic80.com/play.

The community also hangs out and discusses on Telegram or Discord.

Contributing

You can contribute by reporting a bug or requesting a new feature on our issues page. Keep in mind when engaging on a discussion to follow our Code of Conduct.

You can also contribute by reviewing or improving our wiki. The wiki holds TIC-80 documentation, code snippets and game development tutorials.

Build instructions

Windows

with Visual Studio 2017

  • install Visual Studio 2017
  • install git
  • install Ruby (you can use RubyInstaller)
  • run following commands in cmd
git clone --recursive https://github.com/nesbox/TIC-80 && cd TIC-80/build
cmake -G "Visual Studio 15 2017 Win64" ..
  • open TIC-80.sln and build
  • enjoy :)

with MinGW

  • install mingw-w64 (http://mingw-w64.org) and add .../mingw/bin path to the System Variables Path
  • install git
  • install cmake (https://cmake.org)
  • install Ruby (you can use RubyInstaller)
  • run following commands within a mingw64 context, for example within a MingW64 shell
git clone --recursive https://github.com/nesbox/TIC-80 && cd TIC-80/build
cmake -G "MinGW Makefiles" ..
mingw32-make -j4

Linux

Ubuntu 14.04

run the following commands in the Terminal

sudo apt-get install git cmake ruby-full libgles1-mesa-dev libglu-dev -y
git clone --recursive https://github.com/nesbox/TIC-80 && cd TIC-80/build
cmake ..
make -j4

to install the latest CMake:

wget "https://cmake.org/files/v3.12/cmake-3.12.0-Linux-x86_64.sh"
sudo sh cmake-3.12.0-Linux-x86_64.sh --skip-license --prefix=/usr

Install with Install instructions

Ubuntu 18.04

run the following commands in the Terminal

sudo apt-get install g++ git cmake ruby-full libglvnd-dev libglu1-mesa-dev freeglut3-dev libasound2-dev -y
git clone --recursive https://github.com/nesbox/TIC-80 && cd TIC-80/build
cmake ..
make -j4

Arch

run the following commands in the Terminal

sudo pacman -S cmake ruby mesa libglvnd glu
git clone --recursive https://github.com/nesbox/TIC-80 && cd TIC-80/build
cmake ..
make -j4

Fedora 36

run the following commands in the Terminal

sudo dnf -y groupinstall "Development Tools" "Development Libraries"
sudo dnf -y install ruby rubygem-{tk{,-doc},rake,test-unit} cmake libglvnd-devel libglvnd-gles freeglut-devel clang libXext-devel SDL_sound pipewire-devel pipewire-jack-audio-connection-kit-devel pulseaudio-libs-devel
git clone --recursive https://github.com/nesbox/TIC-80 && cd TIC-80/build
cmake .. -DCMAKE_CXX_COMPILER=clang++ -DSDL_ALSA=On
make -j4

Install with Install instructions

Raspberry Pi (Retropie)

First, add jessie-backports repo to your /etc/apt/sources.list

deb [check-valid-until=no] http://archive.debian.org/debian jessie-backports main

Then run the following commands in the Terminal

# required public keys
gpg --keyserver pgpkeys.mit.edu --recv-key  8B48AD6246925553
gpg -a --export 8B48AD6246925553 | sudo apt-key add -
gpg --keyserver pgpkeys.mit.edu --recv-key 7638D0442B90D010
gpg -a --export 7638D0442B90D010 | sudo apt-key add -

# upgrade system
sudo apt-get update
sudo apt-get dist-upgrade

# install software
sudo apt-get install git build-essential ruby-full libsdl2-dev zlib1g-dev
sudo apt-get install -t jessie-backports liblua5.3-dev
git clone --recursive https://github.com/nesbox/TIC-80 && cd TIC-80/build
cmake ..
make -j4

# install software ubuntu 22.04.3 LTS
sudo apt-get install git build-essential ruby-full libsdl2-dev zlib1g-dev
sudo apt-get install liblua5.3-dev
sudo apt-get install libcurl4-openssl-dev
git clone --recursive https://github.com/nesbox/TIC-80 && cd TIC-80/build
cmake ..
make -j4

Install with Install instructions

Note: If you are using a normal Raspberry Pi image (not Retropie) you may not have OpenGL drivers enabled. Run sudo raspi-config, then select 7 for "Advanced Options", followed by 6 for "GL Drivers", and enable "GL (Fake KMS) Desktop Driver". After changing this setting, reboot.

Mac

install Command Line Tools for Xcode and brew package manager

run the following commands in the Terminal

brew install git cmake
git clone --recursive https://github.com/nesbox/TIC-80 && cd TIC-80/build
cmake ..
make -j4

to create application icon for development version

mkdir -p ~/Applications/TIC80dev.app/Contents/{MacOS,Resources}
cp -f macosx/tic80.plist ~/Applications/TIC80dev.app/Contents/Info.plist
cp -f macosx/tic80.icns ~/Applications/TIC80dev.app/Contents/Resources
cat > ~/Applications/TIC80dev.app/Contents/MacOS/tic80 <<EOF
#!/bin/sh
exec /Users/nesbox/projects/TIC-80/build/bin/tic80 --skip --scale 2 >/dev/null
EOF
chmod +x ~/Applications/TIC80dev.app/Contents/MacOS/TIC80dev

Make sure to update the absolute path to the tic80 binary in the script, or update the launch arguments.

FreeBSD

run the following commands in the Terminal

sudo pkg install gcc git cmake ruby libglvnd libglu freeglut mesa-devel mesa-dri alsa-lib
git clone --recursive https://github.com/nesbox/TIC-80 && cd TIC-80/build
cmake ..
make -j4

Mesa looks for swrast_dri.so from the wrong path, so also symlink it:

sudo ln -s /usr/local/lib/dri/swrast_dri.so /usr/local/lib/dri-devel/

Install instructions

Linux

To install run sudo make install -j4

TIC-80 can now be run with tic80

iOS / tvOS

You can find iOS/tvOS version here

Credits

tic-80's People

Contributors

alectroemel avatar andreirudenko avatar asiekierka avatar blinry avatar blueloveth avatar bonjorno7 avatar bztsrc avatar ddelemeny avatar dressupgeekout avatar frenetic avatar gota7 avatar grahamclemo avatar jahodfra avatar jettmonstersgoboom avatar jminor avatar josefnpat avatar joshgoebel avatar koltenpearson avatar neolight1010 avatar nesbox avatar phcoder avatar pierceng avatar robloach avatar schraf avatar soxfox42 avatar sthilaid avatar technomancy avatar txgruppi avatar wadetb avatar wang-yue avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tic-80's Issues

mouse scroll

Hello,

I don't know if I'm alone, but I have a problem with the trackpad scroll on my mac.
The scroll down only and doesn't up.

But it is not blocking, it's just a little bug.

What if I want to make big multiplayer game?

Hello, Vadim. Your project is awesome! I fell in love at first sight, thank you very much for your work! :3

I actually have a question - what if I want to make something more than little 64k game? I want to make online game with udp-server. Can you add socket support and remove 64k limit? It is possible theoretically?

Ненулевое начальное смещение в редакторе карт

Приветствую! При загрузке картриджа и последующем переходе в редактор карт, текущая карта отображается не со смещением 0,0 и не последняя редактируемая, а по середине и со сдвигом. В равом нижнем углу окна выбора карты возникает небольшой прямоугольный артефакт.

A bug in Android version

My Android phone is connected to the keyboard.
I can't use other than the arrow keys to control when I running my code.
And if I switch the apps, when I open the TIC again, it will not be able to input, only can restart.

Syntax coloring for moonscript

This is not important, but it would be nice to have syntax coloring for moonscript.

And since we can change the symbols for whitespace characters, those characters should be colored lightly relatively to the text.
I mean by that the background of the text editor use color 0, regular text use color 15, so whitespaces should use color 1 rather than color 15 to be darker.

HOTKEYS rectification

Hi,
Left bracket on french windows keyboard use Alt+4 , when I use Alt 4 it's change screen to go sfx editor. Can you remove this hotkey and leave only alt+F4 hotkey or fix this bug.

Thanks

Camera operator

Maybe implemented camera operator for a smooth scrolling like as PICO-8?. If the camera operator is not specified in the user program(script), use the only map operator for backward compatibility.

pbtn clarification

Not sure if pbtn is working as it should. If I keep pressed a key pbtn return true every odd frame.
I was expecting to only receive true again after releasing and pressing again the button.
Try in Win10 64Bit with 0.0.13 and 0.0.12

Other Api method

Hello,

I saw snippet function in the wiki
Have you plan for other api function like circ functions in native api in the future?

And have you got a roadmap? if yes can you share it? :-)

Bugs in the windows store version 0.15.0

It seems that the windows store version is quite bugged.
for example:

  • the key 'O' open the search function in the text editor.
  • whatever we run in the terminal, it will interpret it as 'run'

There might other bugs, but I cannot look further.

font customization for all characters

in the config.lua file, we should be able to customize the TAB character in order to avoid mistakes in moonscript.
Character customization could be extended to all ASCII characters (from 0 to 127).

Cartridge metadata editor

add following metadata to cart:

  1. title
  2. author
  3. description
  4. tags
  5. input method (gamepad/mouse)
  6. ...

and implement method to edit meta info

Hotkeys for Mac (again :-)

Can you add hotkeys for mac ?

normally for mac user:
cut it's cmd+x
copy it's cmd+c
paste it's cmd+v

have you plan to implement undo , redo ?
undo: windows : ctrl+z / mac: cmd+z
redo: windows : ctrl+shift+z or ctrl+y / mac: cmd+shift+z or cmd+y

Add new console command 'folder'

As the Pico-8 FOLDER command, it is really convenient.
'FOLDER open the current directory in the host operating system's file browser'

Moonscript support

  • If the first line of the script as the exact tag "--[moonscript]" then all the code is in moonscript,
  • otherwise it is in LUA

Black borders

As you requested i'm creating an issue here about the black borders that are present in some resolutions.

Make config.lua editable from TIC

The new config.lua file is visible with the dir command but is not editable from TIC.

image

It would be nice to allow edit it. It doesn't look so bad in the editor:
image

DIR console command

Good day! I saw that the DIR console command does not work in the local version of Win XP. Reports: file system is empty try to use ADD command. Although the files are located in the working directory C:\Documents and Settings\cito1\Application Data\TIC - tiny computer\0.16.0 dev

Sockets support

Add luasocket support please for multiplayer games.

(I hope, I will able to download more than 64k of code from the server) :Ь

Second gamepad not processed correctly.

I used this test program.
Clicking on the keyboard work out okay, but both of the gamepad are displayed as the first gamepad. Secondary gamepad displayed as first.
For example in the pico-8 both worked )
The operating system is Windows 7, if it is important.

--Key Test Project
--By Rain_Effect
local x=70
local y=25
local btnLabel={"Up","Down","Left","Right","Btn A","Btn B"}
function TIC()
    cls(0)
    print("Key Test Project",x,y)
 print("Btn",x,y+15,2)
    print("1P",x+50,y+15,2)
    print("2P",x+80,y+15,2)
    for i=1,6 do
     print(btnLabel[i],x,y+(i+1)*10+5)
        if btn(i-1) then
      print("On",x+50,y+(i+1)*10+5,11)
        else
      print("Off",x+47,y+(i+1)*10+5,6)
        end
        if btn(i+7) then
      print("On",x+80,y+(i+1)*10+5,11)
        else
      print("Off",x+77,y+(i+1)*10+5,6)
        end
    end
end

Add some buttons/change axis buttons

Sorry for my bad language, I'm french ! :)

Change axis buttons

I requesting to change axis buttons (left,up,right,down).
I think, it's would be more user-friendly if btn(0) and btn(1) return a integer variable for axis pressed:

  • btn(0) return -1 => left pressed
  • btn(0) return 1 => right pressed
  • btn(0) return 0 => left or right are unpressed

Why ?

more realistic

In fact, on a joypad NES joypad reference, it's impossible to press left and right in same time.

But with the current buttons configuration, I can do this:
if btn(2) and btn(3) then x=x+1 end

more useful for moving object in axis

With -1 to 1, we can moving object in TIC axis:

-- 'hello world' demo

function btnAxis(which)
	if which==0 then --x axis
		a=2
		b=3
	elseif which==1 then --y axis
		a=0
		b=1
	end
	
	if btn(a) and btn(b) then
		return 0
	elseif btn(a) then
		return -1
	elseif btn(b) then
		return 1
	else
		return 0
	end
end

t=0
x=104
y=24

function TIC()
	--[[ old dummy code :)
	
	if btn(0) then y=y-1 end
	if btn(1) then y=y+1 end
	if btn(2) then x=x-1 end
	if btn(3) then x=x+1 end
	--]]
	
	-- new super function
	x=x+btnAxis(0)
	y=y+btnAxis(1)
	
	cls(12)
	spr(1+(t%60)/30,x,y,-1,4)
	print("HELLO WORLD!",84,64)
	t=t+1
end

Add some buttons

I thinking about add select, start, L trigger, R trigger buttons, but I think it's to much.
How about add just start button ?

Configuration for startup sound

The sound on startup is quite loud.
It would be nice to change the volume of TIC-80 (in the config file)

And why not being able to create a custom startup sound.
So that the user can reproduce the startup sound of the gameboy or other systems.

Mouse support

Would it be possible to add an API function for polling mouse coords and buttons? Or maybe a memory location one could use to peek() the mouse data?

set back 'demo' command on 0.16.0

On startup, all examples are download on folder.
Even if I use 'del' command or delete manually on ".local/share/TIC-tiny computer/0.16.0 dev/" (on linux system)

Crash on attempt to export

Linux 64-bit executable, crashes silently for all of "export", "export html", and "export native" after flashing screen for save destination.

VERSION command for dekstop

I'd find it nice to have a command for downloading a specific version of TIC from the console so I don't have to visit the itch.io site every time it is updated.
Its one parameter would be the version name/number.

shake screen API function

add a function to draw entire screen buffer with XY offset
shake [x y]
the offset will reset every frame to 0:0 if you won't call the shake api

fullscreen font size

Hi,

It's possible, when you are in fullscreen (or not) to decrease font size?
or implement a increase/decrease font size?
increase: ctrl+ +
decrease: ctrl+ -

Can't save clean cart

It's a bit odd but here how to reproduce it:

  • make a new cart
  • save with a name
  • -->can't save

Open the code editor write just one char (or more), now you can save. It seems like the modification can come from any editor.

What about if the NEW cart will contain at least the TIC function definition? At the end TIC function is strictly required.

Add copy/cut/paste buttons to code and sprite editor

Being able to use TIC on Android is great, however CTRL+C, CTRL+V do not work making it difficult to create animations, or fixing some code issues without redrawing and retyping.
Maybe we can have cut, copy and paste buttons along the top right of the header bar? Or with the other tools in the sprite editor?

Undo and redo would be a nice touch as well.

Configure buttons mapping

Make a tool to configure keyboard and gamepad buttons mapping.
Save the mapping settings in local storage.

[Web export] Sound lags

When playing a sound, after some time, it starts lag. And every time you keep playing sounds it lags more and more.

How to reproduce:
Any sound will starts to lag. Just open the sfx editor and press a key on the piano. At first there is a small lag. Keep pressing more keys, and the lag time starts to increase with every key pressed.
After some time, it will be a lag like 2 or 3 seconds on each key press.

Tested in Windows 7 with Chrome, Firefox and Opera. All with the same result.

sprites flag

Hello,

Can you add in the sprite editor a sprite flags like pico8?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.