At the moment I am trying to make a sound play once during a collision.
The collision doesn't stop player speed, but rather the player can "run" through the collision box.
This means that the collision function returns true for several frames in the game.
Whilst can get a collision to play a sound, because the function is returning true for several frames the sound bite keeps restarting every frame.
Could someone please explain how I could make it so that
Whilst collision = True
Sfx plays all the way through(only once though)
I am currently trial and erroring my way through this, but I wondered if I could cut that a little shorter by asking a question on here. I did try searching online for tutorials regarding this but they either make a sound effect play when a button is pressed, or something that doesn't necessarily apply to a situation like this.
Hi everyone, i've been working on a pico-8 project to act as a stepping stone to a harder project.
Whilst it's going smoothly, it would be alot easier for my project if I could animate over a table of
sprites rather than the regular spr += 1 thing I see in all the tutorials.
It would allow me to use any sprite i needed from the table without having to organise the table so strictly. Furthermore, because I am using 2x2 sprites I can't as easily loop over sprites using the regular method because just going to the next line of tiles won't really help.
I tried checking some games on splore but I havn't found an answer yet.
Does anyone know a good solution?
As exams get closer, for some reason I started getting interested in Pico-8 again (terrible timing), but as a total beginner to programming im not to sure where to start, even when I follow tutorials online I find myself understanding the code (at least how it applies to the rest of the program), but I never manage to really retain the information, sadly looking at source code only gets me so far, understanding a little but not a lot.
There seems to be a huge gap between knowing how to make a breakout clone, and being able to knowing enough tools to make your own game no matter how simple (within the limits of pico 8). That being said, im incredibly glad that there is such an enthusiastic community who is willing to make videos and fanzines that will teach new people how to use pico 8. Another issue is that as soon as I try to deviate from the tutorial I run into issues that I cannot seem to solve, and due to the nature of online teaching it's very difficult to get advice.
As a result I decided that to help me understand how to program I should really get to grips with the syntax. To do this ive set up a long question sheet which looks at the Pico-8 manual, and asks questions on the various parts. Then I use the internet and other resources to find the answers.
I've found it very useful, and I thought I might post it here for other beginners to use, I try to cover as much as possible with the questions, but most are very basic.
If you have any suggestions or amendments, or want to contribute to the more difficult questions, pleasure feel free to edit the list accordingly. I understand that the list doesnt teach you how to actually program and think likea computer, but I hope it goes some way to helping people know what the tools they have at their disposal.
- What are the three key functions?
- What do they do?
- What are the buttons in numbers?
- What is a function?
- What is a type and assignment?
- What is a number?
- What is a string?
- What is a Boolean?
- What is a table?
- What is an array?
- What is a string?
- What is a conditional in code.
a. What is the syntax?
- What is a loop?
a. What is the syntax?
- What is a local variable?
- How is it used in a function?
- What is indexing in programming?
- What do they mean by 1-based indexing?
- What notation can we use for an index that is a string?
- What are the unary math operators?
a. What are these in code?
- What is clipping?
a. What is the code for setting clipping in pico 8.
- What code do I use to get or set the colour of a pixel at x and y.
- What is the code I use to get or set the colour of a sprite sheet pixel?
a. What is a spritesheet?
- What code do I use to get or set the value of a sprites flag?
a. What is a sprite flag.
b. What is the value (v) of a sprite flag?
c. What is the initial state of flags 0/7
d. What is the meaning of a sprite flag?
e. What is a bitfield?
- How would you print a string?
- How would you set the cursor position and carriage return margin in code?
a. What is a carriage return margin?
- How would you set the default colour to be used by drawing functions?
a. What is drawing functions?
- What does cls[col]?
- How do we set a screen offset of -x,-y for all drawing operations Camera() to reset.
a. What is a screen offset?
b. What is a drawing operation?
- What is the syntax used to draw a circle?
- What is the syntax used to draw a rectangle?
- Explain what is meant by “Draw all instances of colour c0 as c1 in subsequent draw calls”.
- What are the two types of pallet, and why might we use them?
a. What is the syntax used here?
- How do we set transparency for a certain colour on the screen (to make sure that a certain coloured pixel doesn’t show).
a. What is the syntax used to show this?
- How would be draw a sprite n at a position in syntax.
a. How might we flip this sprite on the X and Y axis?
b. What is the width and height by default?
- How would be stretch the rectangle from a sprite sheet.
a. What is meant by this?
- How might we fill a patter of 4x4 2 colour tiled pattern?
a. What shapes use this?
b. How can we determine what fill pattern is used?
- What is a table?
a. How do we add a value to the end of a table?
b. What is the syntax used to create an empty table?
- How do we delete the first instance of a value in a table.
a. What is the syntax used to do this?
- What syntax is used to iterate over all items in a table in the order they were added?
a. Can you give an example of how this would look?
- What does the syntax foreach t f do?
- How would we check if only a button is pressed, rather than held down.
a. What might we do this?
- How do we play SFX on a certain channel?
a. How do we stop a sound on that channel.
b. How do we stop a sound on that channel from looping?
c. How do we automatically choose a channel that is not being used?
d. How do we stop the sound from playing on any channel?
- How do we start playing music from pattern n.
a. How do we stop the music.
b. How do we specify which channels reserve certain music?
- What is the grid for the Pico-8 map?
- What syntax is used to get or set a map value (v) at x,y.
a. What is the difference between “get” and “set”.
b. What is the exception of sprite 0?
c. Give an example in syntax and explain it.
d. What are the defaults in cel_w and cel_h are not specified?
- How do we return the maximum, minimum, or middle value of a paramenter?
- What is in integer?
- How do we use flr x and ceil x?
a. Give some syntax examples.
- How do we return the square root of a number?
- What is the absolute positive value of a number?
a. How do we find this in syntax?
- How do we return a random number.
a. How would we make this an integer?
- How do we set the random number seed?
- How do we add an extra item to the pause menu?
- How do we print the length of a string?
- How do we join a string?
- How do we grab substrings?
a. What are substrings?
b. What is grabbing a substring?
- How do you return the name of the type of value x as a string?
a. Why would you do this?
- How do you convert a value to a number?
a. What happens if the value is a string?
b. What if the conversion fails?
- How do you create a save state?