AllanR's Recent Forum Activity

  • palmer Construct 2 can certainly do what you want - and it doesn't get any easier than C2 from what I have seen.

    C2 doesn't export swf files, but it does build HTML5 games that run in browsers.

    There is a learning curve to get over, but there are lots of templates to try, tutorials to read, and a very friendly and helpful community if you get stuck. Best of all, you can try the free version to see how it all works.

  • Vaank the first method was the way I was suggesting. It gives every empty space an equal chance of getting an enemy with one quick loop through the array.

    If you just randomly pick array.x and y locations, you would be picking non empty locations and occasionally be picking the same empty location, so it isn't going to be more efficient - unless your array is huge and you want relatively few enemies.

    The first method gives you the potential to set up your array to adjust the possibility for creating enemies in certain areas - you could use a range of numbers to influence where the enemies are: 0 means location is filled, 1 means empty but no chance of enemy, 2 = small chance, 3 = medium chance, 4 = high chance. You could also use different number ranges to indicate what types of enemies can be created in various areas...

    But, as always, there are many ways to do things - you just have to decide what works for you and gives you the result you want.

  • If you have approximately 100 empty tiles, and want about 10 enemies, then loop through the array and give empty tiles a 10% chance of having an enemy. (use Compare two values where the first value is Round(Random(10)) and the second value is 5, then create enemy at that tile location.

    if you want an exact amount of enemies, then keep looping through until the desired number have been spawned.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • just add physics to the ground - and make it immovable.

  • Yes, the canvas plugin has an rgbaAt function that can be used to find the color at any point on the canvas object.

  • as a subevent under On Clicked,

    use System > compare two values, where first value is Button.IID

    and second value is the IID to look for (they start with 0, so you will have 0, 1, or 2)

  • Animate

    you could create an invisible "guide" sprite with image points spaced out a little wider than the sprites and pin the sprites to it. if that guide sprite has its origin in the middle, then that would be easy to place in the middle of the screen. Moving that sprite would then move the whole group...

    otherwise you would have to manually, sum up the widths of the sprites, and add in the distance you want between them and calculate where to place each one.

  • PolicyLobbyz22

    set your player's platform Y vector to -250 (or more if you want more of a bump.

  • if the levels share the same functionality and basic rules, then using one event sheet would make life much easier - especially if you want to make some minor change that would affect all levels.

    you could create groups on the main event sheet and disable any groups that may not apply to certain levels to cut down on unnecessary processing.

  • you can put the object(s) in a family, then pick the first one by the object and the second one by the family.

  • Harlequin

    check out this thread from yesterday: https://www.scirra.com/forum/how-do-i-do-custom-pathfinder-for-hex-maps_t152368

    R0J0hound wrote an outstanding example of how to implement the A* algorithm - which is similar to Dijkstra's Algorithm

  • Majinboo

    well, I am not sure I fully understand what you are trying to accomplish here, but I restructured your capx the way I think you want it to work... (it looked like you wanted to allow up to 2 of any name to be pinned, but after that no more of that name could be pinned).

    I didn't use the HavePin and PinDuplicated variables because I was able to do it without them, and they were just complicating things (you were only marking pinned ones as duplicated but that was not stopping additional ones of that name from getting pinned because if they were unpinned they were not being told that name was already duplicated).

    also, you were running the duplicate check on every tick - over and over again, even though most of the time nothing was changing. It is good practice to only check for things when something changes. So, now it only looks for duplicates before it tries to pin the current instance.

    http://www.rieperts.com/games/forum/PinnedObjects.capx

AllanR's avatar

AllanR

Member since 21 Nov, 2013

Twitter
AllanR has 23 followers

Trophy Case

  • 10-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Popular Game One of your games has over 1,000 players
  • x2
    Coach One of your tutorials has over 1,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

19/44
How to earn trophies