Pixel perfick's Forum Posts

  • I want the randomly picked object (from the array pool we dealt with before),to be checked for global variable trues,I am assuming a loop would do this,but it would have to carry on checking if it does,or does not find a true comparison.

    I just can't seem to work out how this is done....

  • Ok,Jayjay,I have muddled together a mixture of your way and mine as my project involves the sprites being destructable,which I think was causing issues with your method in my game...still not 100% on loops,how do I use a loop to check a variable...once the first condition is met...the loop checks through possibles and if one (or more)is a "hit"> do something...if not carry on regardless...I can only seem to get the first checked or a constant flow of hits...how does a sub event differ from a condition inside the main trigger?

    can I just add thanks,for your help...and loops do my head in...lol

  • ....Ok,just to add to my confusion,trying your original cap again,it seems to be working perfectly...all I can think of is that I moved/deleted a condition or event inadvertantly...ooops...sorry!

    I will go over my project again later...and let you know how I get on...

  • Mmmm,that's odd...I will try the cap again,and let you know how I do.

    Thanks for taking time out to check and amend the cap,the hidden sprite idea,maybe food for thought,too.and if it's no problem be worth looking at as an option.

    thanks again.

  • update....Jayjay I have intergrated your steps into my project applying the guide you very kindly passed on.

    And managed to get it half working,as in it will display randomly some/most of the time,but sometimes repeats,adds two to the count,or in my game will not let me collect the tenth sprite...

    however after 3 hours of head-scatching and double checking...I decided to give your tutorial a debug to see what the "values" told me....and I'm afraid your example does the same....bit releaved to be honest...he he...thought I had done something wrong....

    any chance you can look over your example,again please,many thanks...

  • Jayjay,your a star!....just had a quick look over it and it looks like just what I need,later I will try and adapt the procedures into my project,thanks for your help I really appreciate it..:)

  • No worries,new to this too...I think a tiled background does not support custom collision detection,it is basically bounding box collision or none.use a sprite to test.

    If you need to use tiled backgrounds for optimisation reasons,you could put the grass on a tile with no collision and place it in front of your "platform",with collision switched on to give the same effect.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi,I found that using copy collision mask to all,in the animator window,does not work for me,either,but double clicking on my sprite in the layout,does...could it be that you have collision detection set at "bounding box",rather than "per pixel",in your properties?,hope you get it sorted.

  • Jayjay,thanks for response,book has been a good hands on reference with the patchy nature of construct's online documentation.

    I want to understand how the array is used specifically with the loop to eveluate if it has been chosen.

    not sure how to post a cap example,but in game my player,picks up one of ten objects,each is the same sprite,but I want to randomly give the player one of a "pool" of ten bonuses,once given I want it removed from the "pool",giving the impression that each sprite is an individual.

    I have set up an array with ten names,I can get the array to give me the names in random,using a text box,random(10)+1 current.x but cant "pull" that into anything useful,I can only find a command to change the value at a random....which leaves me at square one <scratches head>....

    I have tried various ways of doing so,think array with a loop is way to go.....help!,regards.

  • Hi all,new to Construct,and even newer to the forum,been bashing my head on a wall for three days,trying to work out,how to use an array,or any method really,to give me one of ten random objects,without duplicating the "pick".array seems most suited,and feel it is something "I need to know"

    Now,I kinda get how arrays work,after reading up on them,and understand the check if "picked",repeat till ten process,but can't really grasp how,you manipulate that info into a usable,effect.

    read loads of examples and loaded caps,but most are using system commands,that seem beyond me at the moment,as I want to understand what I am doing,rather than,copy-paste,somebodys example.purchased the Construct game development book by Daven Bigelow,few weeks ago,and arrays are barely mentioned,bit of a hurdle for my project as I can't focus until I get this beat.

    I feel the array command is lacking flexability,somehow,as I can only seem to see the value at random x,or change the value,to something I dont want to change it to!,sure I'm missing something obvious to most.

    so I am looking for a simple basic explanation,of how the array is used with the loop to give me a once only pick from ten.

    Any help would be apprieciated,and apologies if this is covered elsewher,if so I missed it.thanks in advance.

    PS using construct classic r2