Log In  

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

Line Of Sight Function

I`ve created a Line-Of-Sight function that should work for most projects. It checks for map-collisions(using flag0 as the collision layer). Please use it and let me know what you do with it!

I was inspired by this post: https://www.lexaloffle.com/bbs/?tid=48889
But i wanted a simpler starting point for my own approach. A Line Of Sight check is a good starting point for you own approach but also involves some math. So to bypass that step use my function:

UPDATE 16/9/22
added a optional length-variable. Use it to define a max "range" of the that line. Keep in mind that the function already neglects far away points.
Also added a new break point for perfomance.

function can_see(x1,y1,x2,y2,length)
--x1 and y1 are the point of view,length is the max distance of the two points
    local max_length=length or 1000
    local xvec=0
    local yvec=0
    local len=0
    local ret=true  

[ [size=16][color=#ffaabb] [ Continue Reading.. ] [/color][/size] ](/bbs/?pid=116768#p)
20
18 comments


Cart #snake_game-0 | 2022-09-02 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
3

Just wanted to try my hand at a classic game that fits the pico-8 remarkably well.
What's your high score? Have a go! I found it pretty hard getting more than 15.

3
3 comments


Cart #lina_witches_of_the_moon-7 | 2022-10-21 | Code ▽ | Embed ▽ | No License
33

Updates:

Revision 7 (0.1.1) - Minor changes, and bug fixes:

  • Tweak: Mana Burst now grants a new Frog Bomb upon completion. Other effects are removed.
  • Tweak: Triples shots now deal less damage.
  • Tweak: Sprial shots now deal more damage.
  • Tweak: Final Boss's health increased by 30%.
  • Tweak: Now Lina can move between transitions.

  • Fix: Frog Bombs are now consumed when used.
  • Fix: 3rd Witch now summons correct minions.
  • Fix: Final enemies death will not cause immediate stage change.
  • Fix: Frog Bombs now should be less performance killers.

Revision 6 (0.1.0) - Full Jam Release

  • Added: Force Shield pick-up. Deflects enemy bullets, but does not protect against phisical contact.
  • Added: Mana Burst! Higher firerate, Force Shield and Star powers upon filling the gauge. Getting hit resets your progress.
  • Added: Super Star now grants ramming powers!
  • Added: Indication for Super Star and Force Shield timers.
  • Added: In-game tutorial!
  • Added: New enemy patterns!
  • Added: 2 new soundtracks, thanks to: Before you close your mind

  • Tweak: The game is 60 fps!
  • Tweak: Better art for the menu!
  • Tweak: Sour Cream is permanent on the board, always helping you out! Now only shoots the basic player attack due to balance reasons.
  • Tweak: Cat Bomb reworked! Now exists as a Frog Bomb which has higher damage and destroys all on-screen enemy bullets.
  • Tweak: New hitbox and better in-game indication! Refer to in-game tutorial!
  • Tweak: Drops are more frequent on lower health.
  • Tweak: Potions drop more the lower hp Lina has.
  • Tweak: Removed Shield Potions.
  • Tweak: Ghost removed. Broodmothers are added instead. The fire in a diagonal pattern and spawn hatchlings upon death.
  • Tweak: Dragons slightly tweaked in bullet speed and the number of exploding bullets.
  • Tweak: Color of all bullets in-game.
  • Tweak: Witches have their hitbox slightly extended downward.
  • Tweak: Reworked the drop system. Potion should not drop on full HP and your current weapon should not drop.
  • Tweak: Final boss now should be harder, like a proper game ending foe!

  • Fixed: White Witch had incorrect health value.
  • Fixed: Witches have a better indication for hits. Now the whole sprite flashes.
  • Fixed: Moon state text appeared on wrong stages.
  • Fixed: Draw order.

[ Continue Reading.. ]

33
17 comments


I'm new to PICO-8, and am trying to get a basic top-down movement system. So far I have this:

left = btn(⬅️)
right = btn(➡️)
up = btn(⬆️)
down = btn(⬇️)

xspd = (num(right) - num(left)) * player.speed
yspd = (num(down) - num(up)) * player.speed

if fget(player.x + xspd, player.y) == 0 then
	xspd = 0
end

if fget(player.x, player.y + yspd) == 0 then
	yspd = 0
end

player.x = player.x + xspd
player.y = player.y + yspd

num() takes in a boolean, and outputs a number (true being 1, false being 0)
The problem I have, is that I'm trying to stop the player if they hit a wall (The wall's sprite having flag 0), and I'm not sure what to do. Does anyone know what's going on?

1
1 comment


Cart #pico_1k_jam_2022-0 | 2022-08-31 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
19

PICO-1K Jam 2022

The 2nd annual PICO-8 1K Jam (#Pico1k) has now started! 🥳
🌐 https://itch.io/jam/pico-1k-2022

You have until the end of September to make cool things in PICO-8
...by using only 1K (1024) Compressed Bytes of code 🗜️

No pre-defined Sprites, Maps, SFX or Music data allowed.
ALL content must be created using code.

It can be a:
🕹️ Game
🎞️ Demo (Animated or Interactive)
🛠️ Tool or Utility
...whatever you can fit within 1KB, basically!

It's a relaxed, non-competitive jam, running for a whole month.

Please refer to the PICO-1K Jam page for Rules, FAQ & Resources & more info.

[ Continue Reading.. ]

19
6 comments


Cart #flowers-0 | 2022-09-01 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
1


flowers!!!!!

1
0 comments


Cart #demonattack-0 | 2022-09-01 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
33

My Pico-8 game inspired by the 1982 Imagic game on the Atari 2600 and Intellivision consoles.

How to Play

Shoot everything!

Controls

[X] - Laser

Thanks To

  • Finn for testing
  • Paul Niven for getting me on the right track for the player sprite

Version History

  • 0.80 - 30-Aug-2022 - Released
33
9 comments


Cart #gravity_wrangler-1 | 2022-09-01 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

"Gravity Wrangler"

Each world hurtles into the deep, feigning a wandering heart, accelerating their demise. What would they think if they realized that, through the eons, I was the only one standing between them and the frozen abyss...

279 characters

m,o=128,{}for i=1,9 do
o[i]={rnd(m),rnd(m),0,0}end::_::for i=1,18 do
for j=1,64 do
pset(rnd(m),rnd(m),rnd(m)<1 and rnd(3))if(i<10 and j<10)a=o[i]b=o[j]x=a[1]-b[1]y=a[2]-b[2]d=sqrt(x^2+y^2)+.1a[3]-=x/d/999a[4]-=y/d/999
end
a[1]+=a[3]a[2]+=a[4]pset(a[1],a[2],i%9+7)end
flip()goto _
0 comments


Testing my first game for the lazy devs shumps

is a shmup where you need to defend your base and destroy the enemy one.

My very first game ever, very excited!!

Cart #wogoberezu-0 | 2022-09-01 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
2

2
8 comments


i finally came back to pico 8, cant wait to play all your guys's games!

1
3 comments


Cart #carlae-3 | 2022-09-24 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
2


Carlae is a itsy-bitsy snake in 𝟹̶𝟽̶𝟼̶ 358 characters, named after the cute tetracheilostoma carlae, but tetracheilostoma was kind of a mouthful.

changelog

2022-09-24

  • shaved 18 characters
2
6 comments


Cart #wnojezg-0 | 2022-08-31 | Code ▽ | Embed ▽ | No License
5

DESCRIPTION

A.N.N.A. SYSTEMS OPERATIONAL.
PATIENT STATUS IS CRITICAL. MASSIVE INFECTION.
BEGIN PROCEDURE AS SOON AS POSSIBLE.
GODSPEED.

CONTROLS

Directional Keys control menu navigation and the A.N.N.A. CANNON. Press Z to fire and interact with menus. Enter to pause and reset / edit config.

NOTES

I was very lucky to be picked for the livestream of the game jam's submissions, and I had a great time working on what I would describe as 'Blood Peggle' - I hope you enjoy it as much as I liked making it. I do think we made it a bit too hard, but given that you can start on any level you like, I've opted to leave it as is.

CREDITS

This was a project for the A2B2 Game Jam, made by Remagamer and Eleven. You can follow me at https://twitter.com/Remagamer1 if you are so inclined.

[ Continue Reading.. ]

5
1 comment


Cart #newedowebi-0 | 2022-08-31 | Code ▽ | Embed ▽ | No License
3

Things to do:
-fix glitches
-add sound effects
-improve graphics

You have to find four broccoli and bring them to the flag at the beginning.

3
4 comments


Cart #fillp_tool-1 | 2022-08-31 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
2

Work In Progress:
A tool I made to help learn how fillp() code works as well as the 256 colour combinations.
In future I plan to add a hexadecimal readout as well as a means of changing the colour other than rewriting the colour table in _init(). Comments and better organisation of code is also on the to do list.

2
5 comments


Typing help yield on the console or pressing CTRL+U on the yield() function reveals that the help text misspells yield() as yeild().

That's... about it, really.

3
2 comments


Hey there! I'm here with a tool for you people wanting to show off that you, too, can have a website. My little tool here can make a website with your games on it in a jiffy, and has a tutorial for putting it on the web. Hope you like it!

Might style this if anyone cares

2
0 comments


This is something I made for a request on reddit a while ago, and thought I'd share it here.

The timing objects are excellent for using in any game that needs precise timing actions. The timer bars are something I added later, and are not perfect.

> Hope this helps somebody! Timing can be a real headache. But this is very user friendly. There's a full section of notes in the cartridge!

Cart #timerbars-0 | 2022-08-30 | Code ▽ | Embed ▽ | No License
1

1
0 comments


Cart #npirehed-0 | 2022-08-30 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
6

6
7 comments


Cart #hodohabofo-0 | 2022-08-30 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

0 comments


Cart #apiview-0 | 2022-08-30 | Code ▽ | Embed ▽ | No License
1

This is a simple way to browse the internal pico-8 api, which I posted about on Twitter a while back.

1
1 comment




Top    Load More Posts ->