Centra's Recent Forum Activity

  • Thanks for the quick replies, late game would suffer for sure. I'm interested if Construct could even handle mid-game and so far I've got two votes of confidence

  • I am curious if Construct 2 can handle a game like Corporation Inc which

    seems to be made in flash.

    http://www.kongregate.com/games/ArmorGames/corporation-inc

    There would be quite a number of instances on screen at once and I feel like performance will suffer terribly.

    Although my initial instinct is "maybe" I want a second opinion just so I have a better idea of Construct's limitations

  • It seems to be that I need a 2 dimensional array, width set to be the number of frames in the animation and height at 1 which will increment the number of times a given frame is chosen. Now because the frame is chosen outside of the function I need to know how to pass this information back to function in a meaningful way so that it will exclude those frames who have reached the limit.    Just wanting to make sure i'm thinking of this in the right way

    The purpose of this project is to learn this stuff. I try to give specific background because there are many ways to do things and the more scope you have the easier it is to see the best method to go about it. I debated posting expecting this response but opted to because it doesn't hurt to ask. If you say I have everything I need to figure it out, great! Did not intend any disrespect and didn't want to bother you anymore

  • I'm not even sure how to title this but I am working on an answer choosing project. One sprite has multiple frames, each representing a different possible answer.

    There is a function that spawns 3 instances every x seconds and randomly selects a unique frame for each instance such that there are no duplicates via an array. After the function is called, an event picks a random instance from the 3 newly created instances and selects one of them to be the answer by setting a boolean on the sprite instance to true.

    What I'd like to do is take the answer instance and save it's current frame and tally how many times it was picked throughout the runtime so that once a limit of x has been hit, that answer (frame) can no longer be picked by the function choosing which unique frames to select while picking the 3 instances.

    I can't seem to wrap my head around how to go about this. If I pop or delete parts of an array the places shift and i can't keep an accurate tally, on top of that I am dealing with two separate arrays which need to talk to each other somehow.

    Looking for suggestions as to a better way to go about this

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Awesome! The first suggestion made it go crazy but the second one worked. Thank you so much, I would have never guessed that without inside knowledge. Also I checked out your music loops and wanted to say nice work :)

  • Thank you again, I continue to play with it but I feel like you might be babying me at this point.

    So one more question, what needs to be done to pick a random instance of the three new instances?

    <img src="http://i39.tinypic.com/358pero.png" border="0" />

    Do I need to have their UID as part of the array when they are created and pick randomly from one of them? Setting up an XY array where x is the frame and y is the UID? much like the random destroy but with a two dimensional array

    Is it a parameters issue? Where I need to return values in order to pick from those three?

    and about the destroy bit, they will be given bullet later and go off screen, creating 3 more. Though I guess they could just be moved back and bullet across infinity after changing frames and picking a new "answer" block

  • Haha, that's ironic. I upgraded to 145 to access your random destroy example.

    Here is an r139 version. I wanted to know if I was on the right track. I think the problem is with picking the newly created instances. I wasn't sure how to handle it, nor am I certain about the order of operations going on there.

    instancepickconfusion.capx

  • Thank you again for your examples! I will be more careful when I speak of sprites, instances and frames in the future :D

    I wanted to know if I was on the right track. I think it's a problem with picking the instances and adding them to the array.

    In the first example it will generate random frames but they repeat still have duplicates.

    first

    in the second I tried adding UIDs to the array but wasn't sure how to pick them.

    blockuids.capx

  • deleted due to trouble adding capx links

  • That would be very good of you, I greatly appreciate it. Handling multiple instances has been my biggest obstacle ever since I started construct, I feel like once I cross this hurdle things will get much easier.

    So you are suggesting that the shuffle/choose function takes account of the newly created sprite UIDs each time its run and then picks for them? I'm playing with that idea now trying to figure out the order of operations.

    Just a little background:

    ultimately i'm going to choose one of those three sprites each shuffle and prevent it from choosing the same frame more than three consecutive times, and remove certain frames from being chosen after they've been called more than 5 times. But I'll figure that out once this "shuffle" is down.

    It's essentially an educational game and the player is meant to choose the correct answer, the spite placement is also random(got it covered) so I was wondering if it would be easier to use two sprites, essentially two dummies and a dedicated answer for the shuffle function?

  • So I would need to create a function or loop to re-tally all the uids or instance variables to represent the newly created sprites each time they are created and then run the shuffle function that has been edited to look for

    Pick Sprite where Sprite.uid/instance var = loopindex?

  • Thank you very much! I got it working so long as the objects already exist, but my goal is to spawn new sprites, pick frames, then destroy after an interval. it seems that there is something not taken into account when new objects are created because they are always on the same frame, maybe the iids don't reset? How would one take newly created objects into account?

Centra's avatar

Centra

Member since 18 Jun, 2013

None one is following Centra yet!

Trophy Case

  • 11-Year Club
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

14/44
How to earn trophies