Log In  

@Rickerz

Follow
Follow

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.

Thanks.

P#64448 2019-05-16 02:52

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?

P#64314 2019-05-11 03:06

Hi everyone,

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.

  1. What are the three key functions?
  2. What do they do?
  3. What are the buttons in numbers?
  4. What is a function?
  5. What is a type and assignment?
  6. What is a number?
  7. What is a string?
  8. What is a Boolean?
  9. What is a table?
  10. What is an array?
  11. What is a string?
  12. What is a conditional in code.
    a. What is the syntax?
  13. What is a loop?
    a. What is the syntax?
  14. What is a local variable?
  15. How is it used in a function?
  16. What is indexing in programming?
  17. What do they mean by 1-based indexing?
  18. What notation can we use for an index that is a string?
  19. What are the unary math operators?
    a. What are these in code?
  20. What is clipping?
    a. What is the code for setting clipping in pico 8.
  21. What code do I use to get or set the colour of a pixel at x and y.
  22. What is the code I use to get or set the colour of a sprite sheet pixel?
    a. What is a spritesheet?
  23. 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?
  24. How would you print a string?
  25. How would you set the cursor position and carriage return margin in code?
    a. What is a carriage return margin?
  26. How would you set the default colour to be used by drawing functions?
    a. What is drawing functions?
  27. What does cls[col]?
  28. 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?
  29. What is the syntax used to draw a circle?
  30. What is the syntax used to draw a rectangle?
  31. Explain what is meant by “Draw all instances of colour c0 as c1 in subsequent draw calls”.
  32. What are the two types of pallet, and why might we use them?
    a. What is the syntax used here?
  33. 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?
  34. 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?
  35. How would be stretch the rectangle from a sprite sheet.
    a. What is meant by this?
  36. 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?
  37. 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?
  38. How do we delete the first instance of a value in a table.
    a. What is the syntax used to do this?
  39. 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?
  40. What does the syntax foreach t f do?
  41. How would we check if only a button is pressed, rather than held down.
    a. What might we do this?
  42. 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?
  43. 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?
  44. What is the grid for the Pico-8 map?
  45. 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?
  46. How do we return the maximum, minimum, or middle value of a paramenter?
  47. What is in integer?
  48. How do we use flr x and ceil x?
    a. Give some syntax examples.
  49. How do we return the square root of a number?
  50. What is the absolute positive value of a number?
    a. How do we find this in syntax?
  51. How do we return a random number.
    a. How would we make this an integer?
  52. How do we set the random number seed?
  53. How do we add an extra item to the pause menu?
  54. How do we print the length of a string?
  55. How do we join a string?
  56. How do we grab substrings?
    a. What are substrings?
    b. What is grabbing a substring?
  57. How do you return the name of the type of value x as a string?
    a. Why would you do this?
  58. How do you convert a value to a number?
    a. What happens if the value is a string?
    b. What if the conversion fails?
  59. How do you create a save state?

Thanks

P#52531 2018-05-08 11:32 ( Edited 2018-05-24 04:35)

About | Contact | Updates | Terms of Use
Follow Lexaloffle:        
Generated 2019-09-24 09:59 | 0.061s | 2097k | Q:17