Spawn Random Objects :)

0 favourites
From the Asset Store
Easily generate many levels from a set of pre-built scenes (Construct 3 template)
  • Hello guys!

    I have a little problem, (don't know how to figure this out in guild wars)

    .

    I have 4 rows with 10 objects on each row = 40 objects ^^'

    The objects on the rows should spawn randomly on these specific "row-places"

    Now... If a certain requirement is completed, row 2,3 and 4 should move one up and row 4 should spawn new objects...

    Any Idea how you can save row 2,3, and 4 with the random objects and transport them up? o_o'

  • Save the value of the object spawned on them in an array.

    Also it could be good to post a capx to see how you implemented things so far and see what can be done.

  • [It is the 44mb capx from before~ ;/]

    I'll try and make that file smaller tomorrow (currently 3:30am and the spawning doesnt look quite right, but thanks for the answer!)

    Thanks in advance

    Black2key

  • I am here again :]

    Got it to around 5mb, the Problem is still there (cant get my hand around it, tried it a few times and gave up :/ )~

    Klick it!

    Explanation: The important part here is the e-game layout and the e-game code!

    The layout is self-explanatory: you have to press the keys according to the random spawner (I dont have.)

    [The Arrow-Images are in Object types-->Game->Arrows]

    [Arrow = not active and brown, still have to be pressed]

    [Arrowon = active and blue, you should press that arrow]

    [Arrowoff = already pressed, greyed out]

    *When you complete a row,the arrows from the second row should move upwards, and the active [Arrowon] should be on the first position again

    *Every correctly pressed arrow should save an amout of points to a global variable, also every wrongly pressed arrow to it's own global variable. I will show these at the end, but I can do that myself, it is just the hard part with the arrows I am stuck with :)

    [But the active arrowobjects should only go on if they pressed the right arrow.]

    Thanks in advance.

    Black2key

    The first layout is Hauptmen? if ya want to see everything else [not that much]~

    PS: The second, third and fourth row should have the exact same amout of arrows as the first one = 8~

    PPS: The arrows have a 44x44 layout and the layout has a 10x10px lock [First arrow is at 330,80]

    PPPS: Hopefully I did not overthrow you with questions.

    PPPPS: Hopefully you can kind of understand with what I want to achieve.

    PPPPPS: The only active layer in the layout is Arrow

    PPPPPPS: Sorry for my terrible english, [not my native language~]

  • I have a new Version: Made the 4 arrows as an animation (ArrowSprite Folder)

    Frame1: normal

    Frame2: active

    Frame3: passed

    And I made a family with the 4 obects (Arrowfam).

    Klicky

    Again, Thanks in advance

    Black2key.

    EDIT: (3h later...)

    Tried to

    [on start of layout]

           [Create Arrowfam Object on layer 3 at 330,80]

           [set animation frame to int8random(0,Arrowfam.AniFrameCount))]

    To get a random Arrow: but the problem is: I want to start every arrow on every row on frame 0, the passive frame ;/

    [Deleted everything again... back 2 basics...]

  • Sorry for 4x post, but has anyone found the answer or a way how I could solve the problem?

    I have to complete this project in like 2-3 days, and it would be stupid if I fail to make this game work.

    [I know how to do it in my mind, but can't find a solution on how to make that happen in Construct2, as this is my first game in this wonderful program~]

    Again, Thanks in advance

    Black2key

  • When I click to try to download the "new Version: Made the 4 arrows" I end up on a mediafire page that ask me to upload files <img src="smileys/smiley3.gif" border="0" align="middle">

    Could you please try to use dropbox, it's really nicer for the people downloading your projects.

    EDIT: I managed in downloading the 5.8 previous version (2-3 posts above), ignored a nasty error on opening of the capx and...

    Well I still don't get what you're trying to do.

    Arrows images are supposed to change shape/color or something ?

    I don't get at all what you are trying to achieve (as in what is the goal of the game, what are the game mechanics, where are you stuck ? You told something like "arrows should do this/I haven't implemented it yet". You should first implement it then, it would be easier to move one/build on from there)

    Sorry, the project looks good, but I don't know how to help you so far.

  • Haha thanks, I'll try and get to a point where anyone can understand what I want to do!

    [It is a quite simple project, but I guess I did not explain it enough!] :)

    Thanks for the help!

    Black2key

  • Goal of the key: press as many arrow keys as possible.

    [Quite simple game, I know. ;)]

    I am stuck the random generization of the keys and saving them in rows which move up when you complete a row.

    Also, you should see the arrows beforehand (Right now you can just see down arrows~)

    Edit:

    Kay. Did it! :)

    Dropbox link

    Made the concept and fixed the Error, plsease download and look at it~

    It blocks at the 3-8th key, have yet to find a sloution but its just there to grasp the concept I intended to show. ;)

    ---

    Now, there should be 4 rows like that, and when you finish the first line, you should start the first row again. (with new keys from the second row.)

    Thanks for the help

    Black2key

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • here is how you properly do things

    arrowGame.capx

  • Oh my god thank you very very very very very very very very much. You don't know how happy I am right now! :)

    All this useful information! (Like the mute on/off, the easier way to highlight menu-items, the random spawner = introducing me to variables and expressions)

    This is priceless and better than a Tutorial!

    Thank you very much, I already took a few of your snippets into this game. (Also, to teach myself, I am trying to do stuff a bit different, experiment with these variables~)

    We have a really nice community here!

    Yours

    Black2key

  • As a rule of thumb, if you end up with repetition of code, you're doing things wrong.

  • Yann you should write the bible!

    What if you wanted to store the order into an array? So things are not so random..

  • smitchell

    not so random... what do you mean?

  • Yann, I mean us there a way to set the pattern instead if it randomly choosing a arrow

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