Log In  

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

Hello, i'm rather new to this and I am having issues firing a projectile when I press the z key. This is in a simple game I am making. My code is below:

x = 64  y = 64 
	function _update()
	 if (btn(0)) then x=x-1 end
	 if (btn(1)) then x=x+1 end
	 if (btn(2)) then y=y-1 end
	 if (btn(3)) then y=y+1 end
	 if (btn(4)) then shoot(x,y)
 end
	end 
	function _draw()	
	 circfill(x,y,7,8)

	end

	function shoot(bullx,bully)
	local x = bullx
	local y = bully
	local k = y
	while k <= 128
	do
	k = k + 1

 end
 end

Currently It just flys off the screen super quick, how would i slow it down?

3 comments


Cart #51509 | 2018-04-11 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
82

Standard 9/6 Jacks or Better video poker

Controls should hopefully be straightforward (directional buttons and primary action button, e.g. Z), with the following notes:
-Press up to scroll up to the pay table above the play area.
-Secret quick-draw feature: After holding, you may press the secondary action button (e.g. X) to instantly "draw"

Note: This game makes use of audio/video synchronization (particularly in the intro) that seems to not work very well on the web version (on my computer at least; maybe you will have better results) and it looks/sounds way better if you run it in the native PICO-8 client.

Good luck :)

EDIT 2015-06-11: Updated for PICO-8 0.1.1 compatibility
EDIT 2017-06-16: Fixed coin-count display bug, adjusted several sfx volumes to avoid distortion
EDIT 2018-04-10: Added support for some things that did not exist in PICO-8 when I first made this: saving to cartdata (and "cash out" menu option to reset), button glyph on title screen

82
22 comments


Cart #10909 | 2015-05-25 | Code ▽ | Embed ▽ | No License
3

Either P1 button (X/Z by default) will start/restart the game, arrows move. You'll see that the circles follow you in a very predictable pattern. All you have to do is use that pattern to your advantage by making them overlap. Enjoy!

In 2011 I threw together a silly game called Just Evasion using OpenGL and some dodgy C while waiting for a flight. It was my first proper game, in that it was the first game I'd ever felt was remotely finished. Later that summer I made a Flash version of it using Adam Saltsman's Flixel library. Since I've started messing about with PICO-8 I have had many vague game ideas that didn't go anywhere, but one night I thought of trying to remake this old thing again and so here we are. It doesn't ramp up in difficulty the way the original did, but the core stuff is the same. And it was my first attempt at spriting up some letters, which was great fun and brought me back to the old days designing typefaces on copybooks at school. Vibrant times.

[ Continue Reading.. ]

3
0 comments


This works:

t = {}
t[1] = 'a'
t[2] = 'b'

print(t[1]) -- outputs "a"
print(t[2]) -- outputs "b"

whereas this does not:

t = {}
--t[1] = 'a'
t[2] = 'b'

print(t[1]) -- outputs "false"
print(t[2]) -- outputs "false" (expected: "b")

nor does this:

t = {}
t[1] = 'a'
--t[2] = 'b'
t[3] = 'c'

print(t[1]) -- outputs "a"
print(t[2]) -- outputs "false"
print(t[3]) -- outputs "false" (expected: "c")

So apparently if numbers are used as table indexes and they don't start at 1 and proceed contiguously, the rest of the table (after the break in continuity) behaves as if it's empty...or something.

It works as expected in normal Lua 5.2.3 btw

3 comments


Adjustments to the collision detection.

Cart #10908 | 2015-05-24 | Code ▽ | Embed ▽ | No License
5

A simple game to test the waters. Mostly playable. A few bug fixes and polish left. :]

Cart #10903 | 2015-05-24 | Code ▽ | Embed ▽ | No License
5

5
2 comments


Cart #11006 | 2015-05-30 | Code ▽ | Embed ▽ | No License
94

Cart #10937 | 2015-05-26 | Code ▽ | Embed ▽ | No License
94

Cart #10897 | 2015-05-24 | Code ▽ | Embed ▽ | No License
94

A local multiplayer competitive game.
Paint the most area of the floor with the color you are assigned to win.
Catch bombs to paint large area at a time.

[b]Controls

[ Continue Reading.. ]

94
9 comments


Cart #10893 | 2015-05-23 | Code ▽ | Embed ▽ | No License
6

Update: tweaked the cooldown

Cart #10888 | 2015-05-23 | Code ▽ | Embed ▽ | No License
6

just a simple demonstration of the undocumented feature of stat(x)
using the demo musics of course

feel free to use it in your music carts :D

6
6 comments


How do you achieve smooth character movement?

Normally, you'd take a speed value and multiply it by a delta time value so your character moves the same speed regardless of the clock speed. Pico-8 is frame limited to 30 FPS, but it still seems like my character jumps and hops by small amounts if I press and hold a button down.

Is it the right way to put: if btn(0, 0) x += 1.3 (or whatever) in the _update() and then spr(1, x, y) in the _draw()?

4 comments


I'm not a lua expert, so I can be totally mistaken on this - please correct me if so.

I can't see any reason why a variable should be global in pico-8... Defining as a local outside any functions, makes it accessible from that file (or module? or what is the correct lua terminology for this?) and since pico-8 only has one code file, that is essentially makes it global.
And as far as I know locals are way faster in lua than globals.

So I suggest just removing the keyword, and making everything local by default.
If there is a reason for globals, I would still ask for local-by-default, and suggest introducing a "global" keyword - just to save on the code size.

Again, I don't know much about the inner workings of lua/pico-8, so just ignore this if it doesn't make any sense. :)

3 comments


Cart #10855 | 2015-05-22 | Code ▽ | Embed ▽ | No License
3


Update: Actually, why not go a bit further, and create a code viewer. Includes a custom font by me.

Cart #10853 | 2015-05-22 | Code ▽ | Embed ▽ | No License
3


A quine is a non-empty computer program which takes no input and produces a copy of its own source code as its only output.

This achieved by having the program modify it's own source and re-launch via the "run" command.
Essentially it does this:

print([[
(original program source here)
]])
3
1 comment


Can someone explain how arrays work?

It's very much bugging me out :(

7 comments


Cart #10838 | 2015-05-21 | Code ▽ | Embed ▽ | No License
187

-- GOAL
Can you bring the wolf, the goat, the cabbage, the hunter, the gun, the monkey and the washing machine on the other side !?

-- RULES

  • You can only get one of them in the boat at a time.
  • You can hide one object in the washing machine.
  • When you re not around your folks will interract this way :
    you can learn these rules by playing or read them by clicking the 'show' button

    1 The goat will eat the cabbage.

    2 The goat will eat the gun if the hunter is not there.

    3 The wolf will eat the goat.

    4 The wolf eat the monkey if he can't hide on the washing machine

    5 The hunter will kill the wolf with the help of his gun

    6 You need the gun to convince the hunter to come into the boat.

    7 The monkey will turn on the washing machine and destroy its contents if not playing with the cabbage.

    8 The monkey will throw the cabbage at the wolf if they're on opposite sides ( The wolf will flee )

    9 You need help from the hunter to lift the washing machine.

[ Continue Reading.. ]

187
37 comments


is it possible to avoid the aliasing when you move diagonally?

like a movement vector of {1,1} is okay because you are moving full pixels, but { 0.707, 0.707 } starts to alias.

is there anything to be done here?

0 comments


I've been looking at a few carts and most of the closest to being actual games are right on the Lua code limit (but they have plenty of graphical / map space.) It seems that the real major limitation is the code size and not the sprite limit.

The code size limit is causing hard to read code and ugly shortcuts. I absolutely understand the reason for the limit, but I think it should be raised considering the code isn't compiled or compressed and a lot of carts have vast sprite spaces but no more code space. In most applications the code text doesn't cause any appreciable size increase. It's always the graphics and sound assets.

That said, I think there might be some interesting ways to fit more code in the size of that space but at what point does it circumvent the spirit of the Pico-8? Cutting variable names and comments doesn't make a game easier to write or eliminate design fatigue. It just makes it more difficult for difficulty's sake.

I'm not sure if the text size limit has anything to do with the .png cart format though.

11
25 comments


is there a sleep function? it might be a nice to have for certain effects.

1 comment


Cart #11134 | 2015-06-05 | Code ▽ | Embed ▽ | No License
16

WORM

MERIUS ETIS

CONTROLLS = ALL

INSPIRED BY DIARY OF UNSPOKEN TRUTHS, ARTIST, AND I, ROBOT
BY NIALL, MICHAEL, ANd PERSON

OLD

Cart #10815 | 2015-05-20 | Code ▽ | Embed ▽ | No License
16

16
7 comments


Cart #10813 | 2015-05-20 | Embed ▽ | No License
1

This is my friends level he makes them weekly on Wendsdays and normally he posts it on his other friends account DatoneBuilder but he asked me to post it since DatoneBuilder can't now!

1
2 comments


One of the things I love about PICO-8 is the flexibility of input devices; I love that a keyboard is just emulating a virtual controller that has only 4 directional buttons and two other buttons, and that I can use any controller I want (thanks largely to SDL2). That combined with the cross-platformness makes the whole thing feel very inclusive and welcoming.

However, this presents a problem for in-game button prompts or manual text: what should the buttons be called? The directional buttons are pretty standard, but it's the other two buttons that present the biggest issue.

Depending on the input device, the two non-directional buttons could be called lots of different things:
KeyboardZ/X or N/M
Xbox 360 controllerA/B
PlayStation controllercross/circle
etc.etc.
I see most people so far seem to refer to them as Z/X but that is sometimes confusing when I am using my fake USB NES controller, for example :) Also I would imagine it might be confusing for people with non-qwerty keyboard layouts (I'm not actually sure because I've only ever used US qwerty keyboards). And of course all of this also applies to player 2's controls.

[ Continue Reading.. ]

1
23 comments


When I was checking my LD Bingo game I noticed that Pico8 started just fine the mobile browser, but unfortunately I had no way to control it. While I imagine they'd be inappropriate for most games, for turn-based games or one-button games having an option to add on-screen controls would be nice.

9
20 comments


Cart #11571 | 2015-07-12 | Code ▽ | Embed ▽ | No License
7

Keys: c,x,arrows
Don't touch anything.
Watch your fuel meter (hit fuel tanks).
Rewards: rocket 1000pts, ufo 500pts
This was my first Pico-8 cartridge.

Evasive Maneuvers (1994, DOS)

7
4 comments




Top    Load More Posts ->