Hi!
I´m new to pico 8 and I do my first steps in moving an sprite through an dungeon.
that works well, but i the sprite moves on and on while keeping the button pressed
I want to stop after moving one tile in the pressed direction
so for moving on and on you have to press the button over and over again
How can I do this?
I tried it whith
repeat
until btn()==true
return
but it doesnt work
Thanks for help!!


"Tweetcart" which plays Piano Phase by the composer Steve Reich. The music is generated and played in the space of 280 characters (one tweet)!
Here's the code:
n="46bde64db6ed"d=#n j=12800 o={0,0}for i=0,31 do for e=0,1 do poke2(j+i*2+544+68*e,21120+i+e*64) end end g=0 function _update60()for i=1,d do g+=1 for e=1,2 do if g%(90-e)<1then w=o[e] o[e]=w%d+1 sfx(7+e,e,tonum("0x0"..sub(n,w,w)))end end end print("steve reich-piano phase") end |
Here is my code so far. I am trying to get the fish on the screen to move in an upward motion by itself, after I can master this I am going to try to do a collision detection for if the frog touches the fish = game over. Can anyone give me pointers on making the fish move by itself? Thank you
function _update()
fish_sprite+=18
if fish_sprite > 19 then
fish_sprite=18
end
char_sprite+=1
if char_sprite > 9 then
char_sprite=1
end
if btn(0) then char_x=char_x-1 sfx(05) end
if btn(1) then char_x=char_x+1 sfx(05) end
if btn(2) then char_y=char_y-1 sfx(05) end
if btn(3) then char_y=char_y+1 sfx(05) end
end
fish_sprite+=18
if fish_sprite > 19 then
char_sprite=18
end
function _draw()
cls()
map(0,0)
spr( char_sprite, char_x, char_y)
spr( fish_sprite, fish_x, fish_y)
print( time())
end
Is this working with Pico8?
Could you please have a look:
http://retroflag.com/GPi-CASE.html
Where can I download the rasberry pi version?
Pico Lib
After making some games in pico8 I found I was copy and pasting some functions, code designs. With the new(ish) "#include" functionality, I decided to pull those things out into a cart to use as a library. Its still a WIP but right now includes
- Vector obj with some functions
- screenshake manager
- gamestate manager
- Actor class with optional..
- animation (multiple sprites per frame)
- collision (with map flag 1 and other actors)
Examples
One thing I've noticed becoming a little more popular is non-violent gameplay and I really like this trend, even if it's rather miniscule compared to the broader amount of games being made. Violence is a part of our media in general (see the writings of bell hooks for more info) and so it's nice when a game provides different kinds of solutions to obstacles that don't involve 'kicking something else's ass'. Notably, most of these games, though, tend to be in visual novels, but I suspect that there's an infinite amount of possibilities to do non-violent games that aren't simply puzzles or choose your own dating adventure (i'm being sarcastic with the latter, btw) but are still high on action and skill.
I'm just writing this in hopes someone else sees this an possibly thinks of an alternative to the 'kill enemies' approach to gaming. It's been done a billion times (probably literally a billion times at this point) and while I do enjoy a shooty shooty game as I'm an arcade junkie by nature, there's a lot of games I've played that aren't inherently violent and get my palms super sweaty...and yes, I consider abstract games to be of this nature (such as Every Extend, etc.)
