R0J0hound's Forum Posts

  • No need to use an array just use two for loops. In fact the array wouldn't help in the case of the triangle.

    For a 3x3 square whose top left is at x,y do this:

    Global number x=100

    Global number y=30

    Start of layout

    For "row" from 0 to 2

    For "col" from 0 to 2

    --- create sprite at 32*loopindex("col")+x, 32*loopindex("row")+y

    And for a triangle do this:

    Start of layout

    For "row" from 0 to 2

    For "col" from 0 to loopindex("row")

    --- create sprite at 32*loopindex("col")+x, 32*loopindex("row")+y

  • I made an astar capx a bit ago that was decently fast.

    http://www.scirra.com/forum/a-star-algorithm_topic47626.html

    Just tweaked it a bit so it would run continually or once per frame.

    https://dl.dropboxusercontent.com/u/5426011/examples18/astar3.capx

    All the events could be thrown into a function for ease of use if needed. Also all the actions that change the nodes frame and opacity could be removed since they only provide for visualization.

    The one thing that comes to mind to make it quicker would be to use an array for node lookup to eliminate overlap checks.

    I neglected to provide for the case of not being able to find a path, so you may need to add that. Hint: it's when the open set is empty.

  • These are bad game ideas? More like undeveloped game ideas! You just need to some twist added to make it interesting or amusing.

    nickkname

    1. If it was operated by ai and pieces fell as you collected stuff it could serve as a kind of rube-Goldberg style level up system/eye candy. Although I don't know what should be done if the ai looses...

    2. This idea is amusing enough to be played at least once. However the technical problem of setting up the control system to play it would make it not be played. Just change the control method to moving the mouse in a circle or something and you might just get a game as enjoyable as qwop.

    3. Most smart phone games do something like this anyway where you can dish out real money to bypass much of the grinding for points or coins. The bad idea here is you actually pay to end the game.

    Let's tweak the story a bit. You are in line with a massive crowd to get a limited number of tickets to a movie that everyone wants to see but it's only being showed once. You can feel the tension in the crowd as you push and shove to the front of the line along with everyone else. Tempers are short so fighting is inevitable, but the police is there to supervise the event and if anyone creates too much disturbance they will then have the law to deal with. You have to get to the front of the line, buy the ticket and get out of there without having your ticket stolen. The twist is you don't have any money to buy it so you'll have to steal from the crowd. All this while everyone else in the crowd is doing the same to varying degrees.

    Paying the $5 will bribe the cops to help you but the crowd's civility will plummet when they see the injustice! And how long can the cops fend off an angry mob?

    4. Could be an interesting opportunity to explore the other senses. The gui would present visualizations of all the senses which would provide the player with glimpses through the storm. You would need some kind of goal or motivation. A few ideas: Find shelter before you freeze, avoid falling to your death off some glacier cliffs, avoid the half-starved furry raptors, or find your lost cub.

    Joannesalfa

    At face value that's not very interesting, but slap it into a gta style city who's designer took inspiration from MC Escher and you start having something. May I add that it's under constant construction so upgrades such as maps and gps' have temporary value. Can you get to the house before the competition or even coworkers seeking the commission? Can you manage keep your job, find the house and win brawls on the lawn so you can fix that sink first? All while staying under the radar of the law which just so happens to handle violators with lots of bullets.

  • You mean if you had a family called 'pets' which contains 'cat' and 'dog' objects. And you want to know if the currently picked pets is a cat or dog?

    You could do it with an event like this:

    pick cat by uid pets.uid

    It will only run if pets is a cat.

  • Had a tinker with the idea and it does end up with an optimal move path. I also tested out some ideas i had for implementing turned based mechanics. It may have some use to give someone some ideas...

    https://dl.dropboxusercontent.com/u/5426011/examples18/turn_based.capx

    r139, 43 events

    I agree moving your units one space at a time would give the player more control and could be a better control mechanic.

  • Ah, the "g" flag does help. Why use RegexMatchAt() and then rebuild the string when you can just use RegexReplace() where everything is done in one call?

    This now removes all numbers and not just the first number.

    RegexReplace("Hello123", "\d", "g", "")

  • I haven't opened the capx but you should be able to get it to work without any path finding at all. I mean when you highlight all the possible moves for a piece you already have a number for how many spaces away it is from the piece.

    So if you select a spot four spaces away you can select a spot three spaces away next to that. The process can be repeated to find all the grid positions in the path. So you end up with a list of positions that you could move to in sequence with the move to behavior.

    At least that's a thought. I don't have access to c2 ATM to implement it.

  • Try this to remove digits from a string.

    RegexReplace("Hello123", "\d", "", "")

    I haven't tested it but it should work.

    My sources of info were the system expressions section of c2's manual and some JavaScript regex guide I found.

  • While that would suggest a limit, there isn't one. I did a test and C2 is able to draw 40,000 objects at once, way more than 2,500. It can likely do many more. The only limit being the speed at which they are drawn, which is caused by cpu and gpu speed.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • For the math on the speeds and directions of moving through portals there is a capx here:

    http://www.scirra.com/forum/portal-vector-realignment_topic48791_post306636.html#306636

    For standing halfway through the portal and being seen on both ends it's doable with layer masking effects to hide a portion of the player. You'll be using two player sprites at that point for each portal. The most complicated bit will be handling collision detection for the player when moving through the portal. The main example of the problem would be a portal mounted on a solid wall, the wall will have to be set to not be solid or something when passing through. This is where some ingenuity and creativity will be required to get something working.

    For your last question... Put frosting on a loaf of rye bread. If that cake isn't a lie I don't know what is.

  • Checking collisions with 2 objects instead of 6 would be faster since less needs to be checked. With a small number of sprites the performance difference would be negligible, but it could be more beneficial if you have many.

  • One idea that may make it a bit easier to control is to only let the "ComputerProgramSpawn" function get called when not waiting.

    1. Create another local in the "computer spawning" and call it stall.

    2. Add to event 48 a compare stall=false

    3. And change the wait in event 52 two three events:

    set stall to true

    wait 1 second

    set stall to false

  • When not shaking you can simulate bounded with something like this:

    set scrollx to clamp(scrollx, screenwidth/2, layoutwidth-screenwidth/2)

    set scrolly to clamp(scrolly, screenheight/2, layoutheight-screenheight/2)

    I didn't verify the expression names but the idea should be sound.

  • There is no example of this combined with a bubble shooter example that I know of but this topic has some general info on a way to pick a chain of objects.

    http://www.scirra.com/forum/matching-more-than-3-sprites-gem-matching_topic51703.html

  • I wouldn't say a bug really as all "trigger once" is run once every time the previous event changes from false to true. So within a loop i'm unsure what it should do at least I can't wrap my mind around it.

    The is overlapping is only false when none of the objects overlap, so trigger once is working as expected if the for each is removed.

    Or perhaps it is a bug. What do you think the expected behavior should be in the case of the example? Or should there be another condition like "trigger once per object"?