Log In  
Log In  
BBS > Lexaloffle Community Superblog
This is a combined feed of all Lexaloffle user blogs. For Lexaloffle-related news, see @zep's blog.

All | Following | PICO-8 | Voxatron | General :: [Thread List]

 
sat
by verdog
Cart [#sat-0#] | Code | 2019-02-21 | License: CC4-BY-NC-SA | Embed

I tiny little demonstration of the SAT theorem being used for collision detection. Probably isn't perfect, probably is slow, and probably has bugs... but it appears to work at first glance, at least :)

P#62121 2019-02-21 01:39

Hi all,

I've been working on tac08 for the last few months and while it is still is in development, its probably at a stage that other people may find useful. Check it out on github here:

https://github.com/0xcafed00d/tac08

What is tac08?

tac08 is an emulation of the runtime part of the Pico-8 fantasy console written in C++. It takes a .p8 (text format) Pico-8 cart file and runs it closely as possible to the real Pico-8 software.

What isn't tac08?

tac08 is not a replacement for Pico-8, it provides none of the content creation components of Pico-8, such as code editing, sprite and map creation and music tools. You will still require a copy of Pico-8 to make games. Also if you just want to run Pico-8 games you will have a much better experience with Pico-8 than tac08

Why was tac08 written?

tac08's target audience are developers that want to do one or more of the following:

  1. To enable Pico-8 games to be run on platforms that Pico-8 itself does not run on.
  2. To embed Pico-8 games within other game engines.
  3. To make it possible to extend the Pico-8 api and allow games to use features not currently supported by Pico-8

tac08 was written for my own personal use (specifically for items 1 & 3 above) but I have decided to open source it as others may find it useful.

Check out the full(er) documentation here:

https://github.com/0xcafed00d/tac08/blob/master/README.md

P#62111 2019-02-20 21:03

Cart [#zanda00-0#] | Code | 2019-02-20 | License: CC4-BY-NC-SA | Embed
1

Hiya,
Pico-8 is really exciting to me cos I covet old-school music disks by demo crews and this environment leaps out as a way of making them on my own. I've been making my own music for a very long time and do now and then attempt to learn a new discipline so I had a lot of fun with this.

I kinda adore the internal tracker and all its quirks; watching the SFX channels move at independent speeds was sort of eye-opening to me in all sorts of ways.

This has no game-play elements and the code is not going to help anyone progress (in a positive way, at least); it's purely an ego project. Enjoy!

P#62106 2019-02-20 17:05

Cart [#sosiburota-1#] | Code | 2019-02-21 | No License | Embed
1

The start of an implementation of the Royal Game of Ur.

Ur dates back to at least 2400 BC, and was an extremely popular strategy race game for millennia. Hopefully I can do it some justice with my implementation!

Update-
The intro screen is complete and the play-screen is under way.
We can now see pieces on the playing field, and soon we will have the ability to move pieces.

P#62098 2019-02-20 04:49 ( Edited 2019-02-21 05:51)

Hi,

I'm using a metatable for particles in my game. For example, when the player dies the sprite explodes in a burst of pixels. I use rnd() to off-set the player position with a random number, and as I generate a lot of different particles (based on the colors the character is composed of) I want to move the for-loop into the constructor.

Unfortunately, for some reason the randomness doesn't work when I build the for-loop inside the particle constructor. Compare these two examples:

For loop in caller function

particles={}
particle = {
    x_offset=0,
    y_offset=0,
}

function particle:new(o)

    self.__index = self

    local pi = setmetatable(o or {}, self)

    pi.x=pi.x-rnd(pi.x_offset)
    pi.y=pi.y-rnd(pi.y_offset)

    add(particles,pi)

end

function game_over()

    for i=1,6 do
        particle:new({x=p.x,y=p.y,x_offset=12,y_offset=8})
    end

end

Result: I end up with 6 particles, each with a different x and y value due to the rnd() function being passed the x_offset and y_offset values.

For loop in constructor

particles={}
particle = {
    x_offset=0,
    y_offset=0,
}

function particle:new(count,o)

    self.__index = self

    for i=1,count do
        local pi = setmetatable(o or {}, self)

        pi.x=pi.x-rnd(pi.x_offset)
        pi.y=pi.y-rnd(pi.y_offset)

        add(particles,pi)
    end
end

function game_over()

    particle:new(6,{x=p.x,y=p.y,x_offset=12,y_offset=8})

end

Result: I end up with 6 particles, but they all have the same x and y values. As if the rnd() is called only once and then applied to the other 5 iterations of the for-loop.

Questions

  1. Why does the code behave this way?
  2. What's the right pattern to apply here?
P#62086 2019-02-19 20:41

Work in progress, a Defender clone game in progress!
well it's up to you to collaborate in this game!

Cart [#kwebijon-0#] | Code | 2019-02-19 | License: CC4-BY-NC-SA | Embed

P#62085 2019-02-19 19:33 ( Edited 2019-02-19 19:37)

I can't seem to find any tutorials on how to make monsters move or patrol or have movements routines.

Nothing fancy, something like:

Go from A to B, wait a few frames, go to C, wait again, go back to A and repeat.

The monster doesn't even have to notice the player, just walk its path.

I've tried with loops but I can't make it work.

Thank you very much!!! :D

P#62071 2019-02-19 13:42

Just a small snippet from a token-saving discussion on the Discord last night.

If you need to iterate over neighboring tiles (for example when writing a path finding algorithm for 7DRL), this natural approach is pretty token heavy:

-- four directions, 29 tokens
for direction in all{{-1,0},{0,-1},{1,0},{0,1}} do
 local x,y=direction[1],direction[2]
end

-- eight directions, 45 tokens
for direction in all{{-1,0},{0,-1},{1,0},{0,1},{1,1},{-1,-1},{1,-1},{-1,1}} do
 local x,y=direction[1],direction[2]
end

-- eight directions, 43 tokens
directions={0,-1,-1,0,1,0,0,1,1,-1,-1,1,1,1,-1,-1}
for i=1,16,2 do
 local x,y=directions[i],directions[i+1]
end

-- eight directions, 30 tokens
directions={-1,0,1}
for x in all(directions) do
 for y in all(directions) do
  if x!=0 or y!=0 then
   --
  end
 end
end

Why not use trigonometry?

-- four directions, 16 tokens
for i=0,1,0.25 do
 local x,y=cos(i),sin(i)
end

-- eight directions, 24 tokens
for i=0.125,1,0.125 do
 local x,y=flr(cos(i)+.5),flr(sin(i)+.5)
end
P#62065 2019-02-19 10:00 ( Edited 2019-02-19 10:14)

Remember SAM? (https://simulationcorner.net/index.php?page=sam).

Would it be possible in some way to use the white-noise for samples and/or digi-speech?

I'm not talking about a full-blown conversion of SAM (https://github.com/s-macke/SAM), but maybe a smaller version. Also - shouldn't it be possible to use at least 3-bit samples on the PICO-8? (https://gist.github.com/munshkr/30f35e39905e63876ff7)

I'm not the person to dive into this, but maybe someone else might be able to do some sort of conversion of the above. Personally, I would really enjoy being able to have short/small samples and make the Pico speak!

/ Pingo

P#62028 2019-02-18 14:26

Cart [#jojiyazya-0#] | Code | 2019-02-18 | License: CC4-BY-NC-SA | Embed

P#62023 2019-02-18 08:05

Cart [#walrush_1_1-1#] | Code | 2019-02-18 | License: CC4-BY-NC-SA | Embed

Previous version

Cart [#walrush_1_0-0#] | Code | 2019-02-18 | License: CC4-BY-NC-SA | Embed

About

Wal-Rush! is a game of walrii, fish, and flight. Based on a game I made for a programming competition at codewalr.us, this game lets you play as the mascot of the website, Walrii, as he flies through the sky. Collect fish, rack up points, and watch out for the spike mines!

There are three modes: Easy, Normal, and Hard. Try your hand at each of them, and go for the highest score!

  • Easy: Obstacles always move straight. Fish give you 10 points, and running into a spike mine means death.
  • Normal: Obstacles can move straight, or in a wave-like pattern. Once again, fish give you 10 points, and running into a spike mine means death.
  • Hard: This mode adds a "time bar" to the top of your screen. Your mission is to keep it from running out! Fish give you 10 points (and a bit of time), running into a spike mine takes away a bit of time, clocks give you 50 points (and 50% of your time), and hourglasses give you 100 points (and momentarily stop your time from going down).

"Walruses might fly unless the age of miracles is past." - Anonymous

Controls

  • LEFT/RIGHT: Move Walrii left and right.
  • X: Flap Walrii's wings and fly!

(To anyone saying that this kind of game belongs on the Atari 2600...I actually put it on there, too. 😉)

Version History

v1.1 | 2019/2/18

  • Fixed a bug where pressing X for one frame caused Walrii to keep flapping his wings until X is pressed again

v1.0 | 2019/2/17

  • Initial release
P#62016 2019-02-18 05:14 ( Edited 2019-02-18 20:39)

Hi all,

I'd like to set up PICO-8 so that it will run from a USB pen drive and load, run, and save, export, etc to a folder and\or folders on the drive relative to the application.

Ho do I go about doing that?

Thank you.

P#62002 2019-02-17 23:33

Hello everyone, I'm Dead_Pixel.

I recently discovered Pico-8 and I'm really intrigued by the whole concept of it and look forward to getting to grips with it.

I'm really impressed by the quality of the cartridges and look forward to contributing some of my own work in the future too.

Before signing off I have one question - why was Lua chosen as the programming language?

Thanks.

P#61993 2019-02-17 19:52 ( Edited 2019-02-17 20:06)

Cart [#thicctext-0#] | Code | 2019-02-17 | License: CC4-BY-NC-SA | Embed
4

A while ago I made a function for this
https://www.lexaloffle.com/bbs/?tid=30033

This was very clunky so I remade it. It used to have 124 tokens but I lowered it to 43.

You can use this function as much as you want without credit.

How to use:

printl(text,x,y,inner color,outer color,height)

text,
x,
y,
inner color --the color inside the border
outer color --the outline,
height --how far down you want your outline to reach. 0 means the outline has the same width in all directions.

--the x and y are the coordinates of the top right corner of the inside color.

P#61991 2019-02-17 19:32

Cart [#gemhoppico-0#] | Code | 2019-02-17 | No License | Embed
1

P#61983 2019-02-17 17:17 ( Edited 2019-02-17 17:30)

Cart [#blastoff-1#] | Code | 2019-02-19 | License: CC4-BY-NC-SA | Embed
2

The beginnings of a new game for kids and adults who love rockets.

0.2

  • sound, stars, random birds, sky colours, tracking camera
P#61984 2019-02-17 17:07 ( Edited 2019-02-19 01:50)

Cart [#derbyamplify-0#] | Code | 2019-02-17 | No License | Embed
1

CAN YOU DEFEAT THE SKULL?

Kirby samurai clone by @krazl and @verdog.

P#61973 2019-02-17 04:49 ( Edited 2019-02-17 04:50)

Cart [#pugafufahi-0#] | Code | 2019-02-16 | License: CC4-BY-NC-SA | Embed
18

Inspired by an idea from JW of Vlambeer, I built this dungeon generator.

In short it adds a bunch of rooms on top of each other and then moves them randomly around until they don't fit any longer. Usually this makes for some very nice and organic looking scenes. This version also has a bunch of other parameters like wider door ways, interconnectedness, and decoration among others. The example in this thread randomises these parameters but in the code it is fairly easy to set them up to whatever.

I've tried to document it to a degree, so hopefully it can help out if someone wants to dive into my implementation. It should be said though that I primarily wanted to visualise the process and to look nice, not necessarily be the most efficient data structure. ;)

Have fun and let me know if there are any questions!

P#61963 2019-02-16 23:53 ( Edited 2019-02-16 23:54)

A starfield effect, inspired by the old Windows screensaver, though the style is more in line with Star Trek. Use up and down to increase and decrease speed, and press X to show stats.

I used nucleartide's Pico-8 snippets, specifically vec3 and pline(), to do the 3D projection. I was encouraged by reinvdwoerd's Perspective Lines and used his cartridge to figure out how to use pline().

To really get immersed, shout "increase speed to [warp number]!" as you hold the up key or "all stop!" as you slow down to zero.

Cart [#starfield-0#] | Code | 2019-02-16 | License: CC4-BY-NC-SA | Embed
2

P#61959 2019-02-16 22:46

Cart [#dodge_1-0#] | Code | 2019-02-16 | No License | Embed

Dodge is a fast paced reflex game. There is no end, you just have to survive the longest possible. Enemies move towards you and it's game over if they touch you, but they explode and give you a point if they touch each other.
There is a powerup (the ball with fire particles) that you can touch to destroy all enemies that are currently on the screen.
This game is still WIP and will be updated regularly. There will be music, better sound effects, updated graphics, and maybe even some more gameplay elements depending how far we want to go with it.

P#61949 2019-02-16 15:44 ( Edited 2019-02-16 17:32)
View Older Posts
X
About | Contact | Updates | Terms of Use
Follow Lexaloffle:        
Generated 2019-02-21 10:01 | 0.118s | 2097k | Q:183