Voodude's Forum Posts

  • If I understood correctly, the solution should be to compare Mouse.X to Object.X (instead of Mouse.AbsoluteX). If not, can you share a picture of your layout? My mental image of what you're trying to do is a bit fuzzy.

    And when you say "I set a custom cursor to my mouse specific to the UI layer (i.e. Mouse.X("UI"), etc)", are you referring to using Set cursor from sprite?

    EDIT: I should also clarify that if you do Mouse/Object.X(layer number or "layer name"), you'll get the coordinates at that layer.

  • I don't see any code referring to how you set you initalX or initalY. If those numbers are 0, then the objects would all be going to (0,0).

  • This is something simple I did: imgur.com/a/Ho1Hcrd

    I put the List object in a Music Selection layout for you to choose a song before going to the main game. There might be a way that's a little more efficient but this definitely works. The List object also may not fit the aesthetic of your game, so change it as you see fit. Just note that setting any music to play with a While-like command will try to play music every tick. On or When-like commands should be used.

    You shouldn't have to worry about setting up global variables for knowing which song to play. Music will continue to play between layouts unless you tell it to stop. So if you're always going to end up on the Music Selection layout before starting the game, you should be fine.

    Regarding preloading songs, make sure you're uploading your music to the Music folder, not the Sounds folder. As stated in the manual (https://www.scirra.com/manual/52/import-audio):

    It is important to organise audio files appropriately, because audio files in the Sounds project folder are downloaded completely before playing, but files in the Music folder are streamed. This means if a Music track is accidentally put in the Sounds folder, it would have to download completely (which could take a couple of minutes) before it started playing. However, audio in the Music folder can start playing immediately since it is streamed from the server.

    Regardings tags, they just make it easier to categorize your music or label it. In the code I shared above, I gave all the background music the "background music" tag so I could easily stop all of it when needed.

  • I'm confused about how to insert images in posts. Can someone explain how?

  • I don't understand your problem..

    Are you saying that "28,F" should come before "248,H" in sorted array?

    This is happening because you are sorting string values.

    If you want to sort by numbers, I suggest you make a 2D array, put numbers at Y:0 and letters at Y:1, then just use the Array Sort action.

    Note, that in this case numbers and letters will be stored in different array elements. If you need to combine them, you'll have to do this:

    Array.At(x,0) & "," & Array.At(x,1)

    Yes, I'm saying "28,F" should come before "248,H". The sorting is for a high scores screen and the letters represent the names for now.

    It's strange that it seems the bubble sort tutorial project doesn't have any problems sorting strings. I was hoping to shortcut things by storing the number and name in the same spot, but if this will 100% fix everything, I'll separate them. Thanks.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • The code I replicated exactly from a bubble sort tutorial project doesn't want to properly sort in my game. The array in the tutorial project properly sorts from least to greatest. But in my project, it's sorting by the first number just like the default Sort function.

    EDIT: Images of the code: imgur.com/a/A66TgvB

  • korbaach Yeah, I was just using commas for emphasis on the number being bigger.

    R0J0hound Thanks! I'll give that capx a look over.

  • I'm trying to sort an array of high scores. However the sort array function sorts by the first number. So "900" is considered higher than "3,000,000". Is there another sorting function I can use?

  • I just modified some existing code I was working with. The main thing you want is "when UserMedia is NOT speaking" and "Trigger once". In this case, the sound effect I have plays once the speaking ends.

    With this code the event will trigger on the start of frame, but you can implement some safeguards to fix that.

    I actually have to thank you for asking this question. I was trying to figure out a way to have all items you touch on the screen read aloud without lifting your finger. Turns out "when UserMedia is NOT speaking" is what I was looking for.

  • I typically search the tutorials before the forums. Lots of people have written stuff on lists. Here's one that should help: https://www.scirra.com/tutorials/1417/r ... ays/page-1

  • There's a built in function to check if something is still in the layout.

    Add event -> Select enemy sprite -> Scroll to "Size & Position" (or search "outside layout") -> Select "Is outside layout"