Log In  

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

Cart #43812 | 2017-08-31 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

I've been threatening to do it for ages! And I finally did. I made a cart with mouse controls. It is a very simple game: click until you can click no more. That is approx. 32,000 clicks. If you're really bored and want to skip to the end, hold X and click.

That's it! I had fun making the number sprites and especially the cursor sprites. Just threw this together in an hour because it's been a very scattered month as usual.

itch.io page: here

1GAM August 2017

7 comments



We made story-based pick-your-own-adventure games for class. I made one based on the Transformers series!

Use the arrow keys to pick your actions.

Choose carefully!

1
1 comment


Hi all!

I would like to build walls for a shoot'em'up and I know I can obtain the result with map.

What I do not understand is how to make the drawing dynamic.

For example I have the sprite 0 that contains my wall and I would like PICO-8 to draw walls on the side programmatically.

What would be the best approach to do so?

Thanks for your time and patience.

5 comments


Hi all!

I have this collision function:

function are_colliding(entity_a,entity_b) -- are entities hitting each others boundary and not the same type?
 return entity_b.x < entity_a.x + entity_a.w and entity_a.x < entity_b.x + entity_b.w
 and entity_b.y < entity_a.y + entity_a.h and entity_a.y < entity_b.y + entity_b.h
end

It works almost fine but it is not pixel perfect.

I would like to use it in my games and make it as flexible as possible...
For example an issue I am facing is that in my pong game I can have a round ball or squared ball, depending on theme "classic" or "modern".
This moves the "x" and "y" coordinates of the object I take into account and ruins the collision (here's the game in case it helps problem comprehension - collision is still done there "manually"):
https://www.lexaloffle.com/bbs/?pid=43786#p43786

Do you have a suggestion on how to make it as general as possible?

Thanks for your time and patience :)

1 comment


Hey, Zep, I know there's a built-in OS, but I think it would be cool if people cool make their own to use and share like carts.

But what would be great is if you could put in code that will allow you to run cart from the carts from the forum like the default OS

Appreciated if you at least read this post

1
1 comment


Are you able make a cart open automatically when pico-8 is opened?

Is it also possible to make custom key commands?

2 comments


Cart #43771 | 2017-08-30 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
5

I'd like to get in to the demoscene and decided to learn how to do some well-known effects. This is a basic demoscene plasma effect.

http://lodev.org/cgtutor/plasma.html
this webpage helped alot!

5
1 comment


I'm going to talk about how to do this on Mac OS, sorry PC users

in order to do this, you will need to plug your PS4 DuelShock© controller into your computer

Then you will have to purchase Joystick Mapper

Then open joystick Mapper and make a new preset

Then config the preset to Pico-8 controls
Tip: press scan to easily pick the button/joystick you want to use

When done, exit the window and press the box in front of the preset to activate it
then use the controller test i supplied below to test it, change the settings if needed

Viola!


[ Continue Reading.. ]

1
8 comments


Cart #43804 | 2017-08-31 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
9

I made this for my college art museum; they were looking for writers but I'm not really, so I said I would make a video game "poem" of sorts instead, and they indulged me :)

It was in response to an exhibit that included some "lost works" — pieces that are listed as being in the museum's collection, but cannot be located; instead we just had the label information of the missing work of art.

This game is inspired by that label information; I knew nothing about the painting other than what is there on the title page.

It's not much of a game; not much to do but walk and read. Thank you for your indulgence and time, if anyone plays it! It's short, maybe 5 or 6 minutes long.

Many thanks to oli414 for his dialogue text box lib which i keep using.

And to Robby Duguay for the song "Melancholy" from his "9 Songs in Pico-8".

And morgan3d for introducing me to PICO-8, and zep for making it (also I think I have bits of code in this from both of you.)


Changelog:

1.02 yeah I f**ked up on 1.01 it's all better now :S
1.01 Adjusted "GAME OVER" sequence at very end
1.0 Original release

Cart #43763 | 2017-08-30 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
9

9
7 comments


Cart #43757 | 2017-08-30 | Code ▽ | Embed ▽ | No License
2


Faerie Hitball is more or less an exercise in making a game entirely on a pocket C.H.I.P. There are many like it, but this one is mine. You play a glowing butterfly-winged creature with a racquet. Follow the ball and hit it with that racquet, see if you can break the high score of buffer overflow!

Controls: arrows (move) + button 0 (swing dat racquet)

2
0 comments


Cart #43741 | 2017-08-29 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
14

I saw a couple of articles earlier about the Fizzlefade effect from Wolfenstein 3D. It's a transition effect that draws over random pixels, but never draws over the same pixel twice.

I thought this was a cool trick, and I wanted to try it out and see it in action, so I implemented the Feistel network technique from antirez's article. Posting here in case anyone likes the effect and wants to recycle the code.

14
38 comments


Hello you guys !

I'm a new user for a few days now, and I'm having a really strange issue. For whatever reason, btn(0) doesn't work anymore. Not only on my own tries, but also any game from SPLORE. I tried like everything :

  • simple reboot
  • try with success my keyboard on any other app (even carts from the web player of PICO-8 that DO work !)
  • uninstall / reinstall PICO-8
  • try the zip version without installing...
  • assign another key to "LEFT"...

nothing works. It's just not possible anymore to use the btn(0). I'm running the windows version, using windows 7.

Can someone help me with this ?

Thanks a lot !

2 comments


Cart #43755 | 2017-08-30 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA


NOW IT WORKS :D
sorry about that.
hopefully next time I won't have to look up the code to stop or move something.
Cart #43754 | 2017-08-30 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA


I have now added code to stop the paddle on the screen sides!!!!!
I am a bit ashamed that I had to look up the simple code though :<
anyways I learned how to stop them :D
Cart #43733 | 2017-08-29 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

[ Continue Reading.. ]

3 comments


Hi there,

I wrote a script which helps to write lua code in an external editor. The script listens to changes in the .lua file and re-integrates the lua code back into the .p8 cartridge. Each time you save.

So you can happily change lua files and edit assets in Pico-8 and everything gets merged back as soon as you save. Write some code in your editor, switch to Pico-8 and press ctrl-R to reload. It's quick :)

Works great for me in Intelij Idea, where I have syntax highlighting, code analysis and code completion. When trying to call a function, the IDE even shows the function parameters and lua-doc. What more can you ask for?

Some other things the script can do for you

  • include library code (#include library)
  • remove debug code on release (#define debug, #if debug, #end debug)
  • strip comments if you hit the size limit (please consider that comments are helpful for the Pico-8 community ;))
  • convert pico-8 specific statements like += to plain .lua. Some IDEs might work better with plain lua.

That's it, hope you like it. Download it here:

https://github.com/sulai/p8lua

Have a look in the python file, there is more detailled und up to date instructions on the features.

PS: one down side though: the script works for Linux only at the moment, since it uses pyinotify for getting notified about file changes. I'm happy to accept pull requests if you want to port it to windows, maybe doing polling on the .lua files.

2
3 comments


Ok So I will be using this thread to document my probably ultra-slow progress into programming.

I will be making a clone of Atari's "Asteroids", all to teach myself to program, and hopefully motivate me to do things....

So far what I am needing to do is:

Make a Title Screen
Make the Ship
Design the Asteroids
the UFO
Add a score board
Lives
maybe a level count?

I have 0 knowledge how to do this so it will be nice to see if I can do it!

I've thought about using sprites for everything game related, like the ship, UFO, and asteroids.... However I've also though about making it like the 2600 asteroids, without a definite sprite sheet and just use it's basic syntax to draw these things.

any tips would be very helpful as well! I look forward to making something we can all enjoy...hopefully!

6 comments


hi,

i like to make a raspberry pi pico 8 console. is there a way to end a game and go back to splore with gamepad only? i can t find anything about this. cause the console will have no keyboard, so no esc button.

kind regards
husten

5 comments


Cart #43811 | 2017-08-31 | Code ▽ | Embed ▽ | No License
2

I'd like to share my first PICO-8 project. It's a puzzle game of my own design. You need to restore the puzzle by swapping pairs of tiles. The difficulty is that not all tiles can be swapped. It's up to you to discover which tiles can be swapped. Figuring this out is only the first step. The real challenge has then only just begun!

v0.2 After solving the puzzle (within a reasonable amount of moves) you now get a solve key, which grants you entry into the game's Hall of Fame. Capture it. You can reply to this thread with the screen capture. The keys are unique, so don't "re-use" the key of someone else. Furthermore, you really need to solve the puzzle. You cannot cheat by inspecting the source code either.

[ Continue Reading.. ]

2
4 comments


So my Chip came in yesterday, and it's awesome. I've owned Pico-8 on PC/Mac forever but never did anything beyond playing games.

I've done a little pong type tutorial thing and am thinking about doing a small easy game to teach myself stuff about Programming.

My knowledge is about 0 sooo there's that haha...

I think I'm going to start with an asteroids clone to see if it's easy enough for me to understand things like data arrays and tables, also because I love asteroids :D

wish me luck!

(Also if this isn't the right forum area please move it, I had no idea where this post belongs)

1 comment


In case your game gets slow, it's always helpful to identify the parts of code that take up too much time to compute. This is how you can measure execution time:

local start = stat(1)
-- .... do some intensive stuff ....
printh("this took "..((stat(1)-start)*100).."% of a frame")

Hope it helps, and thanks to @Felice for pointing out how to accomplish this.

sulai

0 comments


I've been working on my first Raycaster and I ran into a problem I can't seem to fix.
I think it has to do with the CAMX variable, and the Ray Hit section of the code (Specifically CAMX's implementation in the RDIRX and RDIRY values).

Depending on the direction I'm facing I get lines that go straight through everything (With virtually no line-height).

I've also noticed that this bug tends to only happen in the reverse SIDE as the wall it's supposed to hit,
Front wall (SIDE 0) has a line that has the color of a SIDE 1 wall.

Here is how it looks:

Here's the code:

-- Based off of: http://lodev.org/cgtutor/raycasting.html
local w,h = 127, 90

-- starting x and y
posx = 15
posy = 11
-- direction vector (looking direction)
dirx = 0  -- angle size of rays
diry = 0  -- left/right offset of rays 
-- up/down
dirz = 0
-- 2d angles in which rays enter the world at
planex = 0       -- (angle rotation)
planey = 0.66    -- (angle size)
-- field of vision
-- this takes the viewport "width" (planey) and the 
-- max ray angles (dirx), and divides them to find the fov
-- 1:1 = 90
-- some simple algebra is used to change this to be fov
-- variable dependant, hence why dirx isn't defined.
-- dirx / planey
fov = 100

-- misc
rotspd = 0.06
movspd = 0.20
lookspd = 0.8

running = true
linebug = 0
debug = false

world = {
  {1,1,1,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1},
  {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
  {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
  {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
  {1,0,0,0,0,0,2,2,2,2,2,0,0,0,0,3,0,3,0,3,0,0,0,1},
  {1,0,0,0,0,0,2,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,1},
  {1,0,0,0,0,0,2,0,0,0,2,0,0,0,0,3,0,0,0,3,0,0,0,1},
  {1,0,0,0,0,0,2,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,1},
  {1,0,0,0,0,0,2,2,0,2,2,0,0,0,0,3,0,3,0,3,0,0,0,1},
  {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
  {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
  {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
  {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
  {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
  {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
  {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
  {1,4,4,4,4,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
  {1,4,0,4,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
  {1,4,0,0,0,0,5,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
  {1,4,0,4,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
  {1,4,0,4,4,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
  {1,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
  {1,4,4,4,4,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
  {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}
}

function rad(n)
   return n * (3.14159/180) + (0.001)
end

function msin(n) return sin(n*0.159) end
function mcos(n) return cos(n*0.159) end
function msqrt(n)
 local i = 0
 while(i*i <= n) do 
  i += 1
 end
 i -= 1
 local d = n-i*i
 local p = d/(2*i)
 local a = i+p
 return a -(p*p)/(2*a)
end

function mcut(n,degree)
  if(abs(n) > 1/degree)return n
  return flr(n * degree)/degree
end

function updatefov()
-- dirx*-1 / planey = n*90 = fov
-- planey = -dirx * (fov/90)
   dirx   = -(planey / (fov/90))
end

function wmap(x,y)
   x = flr(x)
   y = flr(y)
   return world[y][x]
end

function _init()
  cls()
end

function drawhud()
   rectfill(0,h,128,128,5)
   if(debug)then
    print("rayx: " .. raydx,0,h+8,7)
    print("rayy: " .. raydy,0,h+16,7)
    print("checkerr: " .. linebug,0,h+24,7)
   end
end

function _draw()
   updatefov()
   rectfill(0,0,w,(h+dirz)/2,15)
   rectfill(0,(h+dirz)/2,w,h,4)
    for x = 0, w do
      -- camera offset relative to middle
      -- -n = left, 0 = middle, +n = right
      local camx  = (2 * x) / w -1

      -- min/max ranges of ray directions
      local rdirx = dirx + planex * camx
      local rdiry = diry + planey * camx
      local mapx = flr(posx)
      local mapy = flr(posy)

      local sidex, sidey, stepx, stepy, wall

      -- length of ray from one side to another
      raydx = sqrt(1 + (rdiry * rdiry) / (rdirx * rdirx) )
      raydy = sqrt(1 + (rdirx * rdirx) / (rdiry * rdiry) )

      -- check if wall was hit
      local hit = 0
      -- was a north-south or east-west wall hit?
      local side

      -- find which direction to step in

      if(rdirx <= 0)then
        stepx = -1
        sidex = (posx - mapx) * raydx
      else
        stepx = 1
        sidex = (mapx + 1.0 - posx) * raydx
      end

      if(rdiry <= 0)then
        stepy = -1
        sidey = (posy - mapy) * raydy
      else
        stepy = 1
        sidey = (mapy + 1.0 - posy) * raydy
      end
      -- draw lines
      while (hit == 0) do
        if(sidex < sidey)then
          sidex  += raydx
          mapx += stepx
          side = 0
        else
          sidey += raydy
          mapy += stepy
          -- bug lies here, when rendering the y portions
          side = 1
        end
        -- check if ray has hit a wall
        if(world[mapy][mapx] > 0) hit = 1
      end

      -- calculate distance to project on camera
      if(side == 0)then
         wall = (mapx - posx + (1 - stepx) /2 ) / rdirx
      else
         wall = (mapy - posy + (1 - stepy) /2 ) / rdiry
      end

      -- calculate height of line
      local lineh = -flr( -(h / wall) )

      if(lineh <= 1)linebug = x

      -- calculate lowest/highest pixel to fill stripe
      drawstart =       -lineh /2 + (h+dirz)/2
      drawend   =        lineh /2 + (h+dirz)/2
      if(drawstart < 0) drawstart = 0
      if(drawend >= h ) drawend   = h - 1

      -- get color of wall
      box = wmap(mapx,mapy)
      if(side == 0)then -- x sides
            if(box == 1)then boxcol = 8     -- red
        elseif(box == 2)then boxcol = 11    -- green
        elseif(box == 3)then boxcol = 12    -- blue
        elseif(box == 4)then boxcol = 7     -- white
        elseif(box == 5)then boxcol = 10    -- yellow
        else boxcol = 7 end            -- white
      elseif(side == 1)then -- y sides
            if(box == 1)then boxcol = 2    -- violet
        elseif(box == 2)then boxcol = 3     -- dark-green
        elseif(box == 3)then boxcol = 1     -- dark-blue
        elseif(box == 4)then boxcol = 6     -- gray
        elseif(box == 5)then boxcol = 9     -- white
        else boxcol = 7 end  -- orange  
      end

      -- draw striped line
      line(x, drawstart, x, drawend, boxcol)
   end
   if(debug)then
     print("x: " .. posx, 0,8,0)
     print("y: " .. posy, 0,16,0)
     print("rang: " .. dirx, 0,24,0)
     print("roff: " .. diry, 0,32,0)
     print("prot: " .. planex, 0,40,0)
     print("pwid: " .. planey, 0,48,0)
   end
   drawhud()
end

function rotate(rdir)
  local oldx = dirx
  local oldpx = planex
  dirx   = dirx   * mcos(rdir) - diry   * msin(rdir)
  diry   = oldx   * msin(rdir) + diry   * mcos(rdir)
  planex = planex * mcos(rdir) - planey * msin(rdir)
  planey = oldpx  * msin(rdir) + planey * mcos(rdir)
end

local pmx = 0
local pmy = 0

function _update60()
   --poke(0x5f2d, 1)
   local mx = 0--stat(32) -- x coord
   local my = 0--stat(33) -- y coord

   -- player input!
   if(btn(2))then -- up
        -- collision check, move forwards
      if(wmap(posx + dirx * movspd, posy) == 0)then
         posx += dirx * movspd
      end
      if(wmap(posx, posy + diry * movspd) == 0)then
         posy += diry * movspd
      end
   end
   if(btn(0,1))then -- strafe left
      -- If anyone could help with these it would be great too xD
   end
   if(btn(3))then -- down
      -- collision check, move backwards
      if(wmap(posx - dirx * movspd, posy) == 0)then
         posx -= dirx * movspd
      end
      if(wmap(posx,posy - diry * movspd) == 0)then
         posy -= diry * movspd
      end
   end

   if(btn(2,1))then -- look up
      dirz += lookspd
   end

   if(btn(3,1))then -- look down
      dirz -= lookspd
   end

   if(btn(1,1))then -- strafe right
       -- If anyone could help with these it would be great too xD
   end
   -- rotation!
   if(btn(1) or mx > pmx)then -- right
      rotate(rotspd)
   end
   if(btn(0) or mx < pmx)then -- left
      rotate(-rotspd)
   end

   --pmx = mx
   --pmy = my
end

[ Continue Reading.. ]

1
5 comments




Top    Load More Posts ->