Generate loot...

0 favourites
  • 11 posts
From the Asset Store
Perfect, complete, easy to use to use, out-of-the-box inventory system
  • How do I generate loot pick up for infinite running style game. I want them in a group of 5 as I'm running I can pick them up. Like Mario bro. But every now and the have one in the row that can hurt you.

    I know there is probably as simple way and I'm just not thinking if out.

    Thank you in advance.

  • Sorry, I have no clue about your problem.

    "on hidden that can bur you"

    you mean burn?

    Do you have troubles to create 5 objects or randomly spawn a "bad" one in between?

  • fm4fanAT - I am so sorry I was at work trying to post with my phone and the site is not very mobile friendly.

    Here is a clip from my game. If you can see as he moves up and down I want coins to generate so he can move up and down to get them. It's an infinite scroller so I'm not sure how to implement that. But sometimes the row of coins mad have a bad cone in them so you would have to grab as many coins as you can and avoiding any pitfalls/obstacles that may come.

    Very sorry for my confusion thank you very much.

  • It's a very simple task with spawn point outside the screen and some random or choose in the eventsheet

    so choose which lane the object should spawn = choose (spawn1, spawn2, spawn3)

    randomize e.g. time in between

    randomize which object should spawn variable1 = random (0,1)

    if varibale1 is greater then 0.9 then spawn bad stuff

    there is a tutorial that should help you a lot https://youtu.be/9LDzIiHl97g?t=285 (here he starts using spawn points - but the whole tutorial is excelent)

  • fm4fanAT - Thank you so much I'm all over it... I just wanted pointed the right direction and you've done that thank you.

  • fm4fanAT - You were so right! That is a great tut and I learned a lot. It was not quite what I wanted to do because he had so many things going on that I didn't need it was hard to follow and leave them out but I made it work. And there are so many elements in it that I will pull from for future set ups so again I wanted to thank you and it was your help that got me closer to what I'm trying to do.

    I'm having fun now Thanks

  • Looks like I spoke to soon... After getting deeper into the code and removing the things I did not need it started to get crazy and not working correctly. So I created my own based off the general idea of the video. Now I have one side randomly putting out the coins good loot and bad loot. But here's what I want to do. I just want 1 command that randomly chooses the loot type and randomly sends it to one of the spawn spots (The Yellow Blocks) and in groups of 3 or 5 something like that. Kind of like the other picture above.

    I guess I can do each spawn block separately and stagger the create time but that still won't let me generate them in groups. I hate asking for so much help but I appreciate it just the same.

    Thanks

  • What about creating a bunch more of the sprite spawner but create function for each instance you want and have it For each X number of second random choose a number and then have it find the function name based on that number. So for example let say you have 6 sprite spawner and have it layout liek 3x3 grid.

    and arrange the function to spawn coin at what ever spawner you want such as this three at top just spawner 1 2 3 and if you want a number to choose bottom three 4 5 6.

    im sure you can use lots more but this way you can pretty much use function to spawn the thing and control what pattern of coin you want to use.

  • Gearworkdragon

    Yeah, I can do that, I guess I was trying to avoid all the extra work since from the video he was able to generate a code to do it but I could not get it to work with my set up. But I do understand what you're saying so it's the best option for my code set up.

    Thank you very much.

  • maybe I did not understand properly...but

    spawnLot.capx

    of course you can use just one sprite...and just change frame..

    ..frame0= Coin ;frame1=Hurt ;frame2=somethingElse...etc

    Player on colision with Sprite

    Sprite frame=0.....pick Coin

    Sprite frame=1....hurt player

    Sprite frame=2....do somethin else...etc

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Amazing and you made it look so easy. This is how the vid tut did it but he added so much other stuff I couldn't sift through it.... This is what I need, thank you so and to all that offered help and advice it was all very useful.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)