Lou Bagel's Recent Forum Activity

  • Global Variable "FireRate" initially set to 1

    Every "FireRate" seconds - create object

    Every 10 seconds - Subtract 0.02 from FireRate (or better yet) Set FireRate to FireRate*0.9

  • Are you talking about the quantity or speed?

    Either way you could make a global variable for the fire rate. Every x seconds alter the fire rate.

    Multiple ways to set this up—what is your event for creating the rain drops?

  • Worked like a charm. My brain stopped working and I only figured I could use numbers instead of other variables. Thank you very much sir.

    You are welcome. Any field like that you can use any variable or expression

  • Maybe try:

    Player is on screen (to pick the players that are on screen)

    -compare two numbers: picked count < player count

    --every tick set scale to layoutscale - 0.01 (or however fast you want it to zoom out)

    **off the top of my head—may not be foolproof

  • Now my problem is that even if i buy 10 chickens I am only still receiving 1 egg per second instead of 10.

    For this, right now you probably have "add 1 to eggs", where you clicked on "add to" and when the field popped up you left it as 1.

    Instead of adding 1 to eggs you want to add 1 egg per chicken, correct? So add the number of chickens to the number of eggs. If chickens is already a variable somewhere just put the variable in the field. If chickens are sprites then use the count expression which will count the number of instances in the project of chickens (so be wary of ones off the screen and such). Can't remember if the expression is chickens.count or count("chickens")...

  • Instead of adding 1 to egg add chicken 'count' to egg

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • So, can characters effect and/or be affected by a background tilemap? Like slow down characters going through mud? Or would I need to make sprites for that?

    You should be able to using:

    [quote:283teqi9]Tilemap conditions

    Compare tile at

    Compare the tile ID at a position in the tilemap.

    https://www.scirra.com/manual/172/tilemap

    Although, that could add in a lot of checks every tick

  • Okay, I think I get your situation. I can't look at your capx now but will try to tomorrow if you are still having problems.

    So I assume from this they are typing in the letters on the keyboard?

    One idea off the top of my head is instead of using a textbox to detect keyboard input and only do anything if it matches.

    Either way, I would probably start by loading the letters into an array.

    Create a variable that starts as false (boolean or 0)

    Loop for array.width

    -if [letter to check] = array(loopindex) set variable to true/1

    If variable = true/1 then update text/allow the letter to be added.

    If you let them type anything in the textbox then you would have to check it after and remove as opposed to allow. But you can do the same in a nested loop

    Loop for textboxt.length

    -Loop for array.width

    --if [letter to check] = array(loopindex) set variable to false and end loop

    Can't look at the capx right now so not sure what you have already and if this helps or not...

  • I agree it is a bit odd you can't have the for loop not execute but as blackhornet puts it is just a limitation to deal with. Construct being a 'no coding required' engine has the goal of making things simpler, but when anything is made simpler you lose flexibility.

    You can do it the way you mentioned, you can do it the way I mentioned, you could do x = array.width; while x > 0 spawn & x-- Or while array.width > 0 spawn & remove item from array. All the loops do the same thing just with different formatting to make it simpler in different situations.

  • The problem isn't about the negative index itself, but the behavior of the loop itself. By using end = -1, what I expect is that the loop shouldn't run at all.

    This is what I was doing:

    > for "spawn" from 0 to array.width-1 {
    	create enemy...
    }
    [/code:3rq61buy]
    So if the array size (width) is 2, I will get loop: from 0 to (2-1) ==> result: new enemy.IID 0 & 1.
    If the array size is 1, I will get loop: from 0 to (1-1) ==> result: new enemy.IID 0.
    If the array size is 0, I will get loop: from 0 to (0-1) ==> result: new enemy.IID 0 & -1???
    
    Using multiple by -1 will make: from 0 to 1 ==> result: new enemy.IID 0 & 1, which is still wrong as I got empty array.
    
    In short, the for-loop is more like do-while.
    

    So you are saying that the problem is that it will execute with a negative value?

    That sounds like what it should do because if the ending index is lower than the starting it should change to for(i = 0; i > array_width; i--)

    If your only issue is the loop executing when empty why don't you just but a pre-condition as array.width > 0 ?

  • Setting the scale to integer/browser.DevicePixelRatio did restore pixel-perfect under crop setting.

    Ashley despite the warning it still seems as the crop setting would be the easiest way to create a 'integer scale outer' so to speak. As now that I have it with pixel-perfect all I need to do is check the screen size and set to desired integer, which right now I'm only seeing that 1 and 2 will be needed

  • I wasn't aware of this and am also interested in hearing the answers to your questions, but if you need a simple work-around you can always multiple by -1 or take totalindex-loopindex to count backwards

Lou Bagel's avatar

Lou Bagel

Member since 7 Sep, 2015

Twitter
Lou Bagel has 3 followers

Connect with Lou Bagel

Trophy Case

  • 10-Year Club
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • x2
    Popular Game One of your games has over 1,000 players
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

17/44
How to earn trophies