AllanR's Recent Forum Activity

  • You could have an instance variable for each colour, have them start at 0, and when you collide with a colour, set that variable to 1 (or if it is already 1, set it back to 0).

    Then if the sum of the variables is 5 you know you have all the colours.

    The trickier part is showing what colours you have, because there are a lot of possible combinations of the colours! (31 I believe). So, either you would need to have that many animations, or you would have to have one additional sprite for each colour, pinned to the player sprite, and show or hide them based on whether you have collected that colour or not.

  • I haven't looked into it too much, but I don't remember seeing anything other than the percentage loaded, so I think you may be out of luck...

  • That would probably work for fine for testing, but once you start distributing your game it would need to access a publicly accessible server. And you would only really need a server like that if you want to have access to the players data, have players share data, or for a global high score list, etc. If you are only storing data for the local player you may want a solution that doesn't require a server. I know there is a CSV plugin, and ways to read and write text files... And I have heard people say they store a lot of data in webstorage.

  • I have used Construct2 with MySQL - using AJAX to make calls to php scripts that read or write to the database. Works great and not very hard to do. There are several tutorials to help you get started. However, you need access to a server obviously...

  • vtrix, I believe Colludium is correct.

    I dragged the group out of the On Start of Layout section and got the incorrect spacing as you described.

    So, I disabled the line "Sprite : Destroy", and then the sprites were spaced correctly.

    Then I changed the Create object line to just create the Sprite on layer 0 at (0,0)

    and on the next line Sprite : Set position to ( 300+ loopindex("y") * (sprite.Width+1), 300 + loopindex("x") * (sprite.Height+10) )

    and that worked fine (even with the "Sprite : Destory" line re-activated). So, basically, it needs to already have a Sprite instance available to get its width and height. You just have to divide the line to create the Sprite first, then position it second rather than do it all on one line...

  • You certainly have the right idea. Although, you could simplify it...

    if you use "Set at X" instead of "Set at XY" you could leave out the extra ",0" at the end of every line that sets or accesses the array.

    You could also easily eliminate the global variables by just putting the random() statement down at the bottom where you set the citizen instance variables. Make sure you put the Floor() outside of the Random() call: you want "Set FirstName to FirstName.At(Floor(Random(FirstName.Width)))"

    Also the last section where you assign the names to citizens will run every tick - constantly reassigning names unless you put that in an "On start of layout" block or in a function...

    One other thing to be aware of, FirstName.Width will be the number of spaces defined in your array, not how many you have used. Your code shows you have set up 3 names, but if your array has room for 10 names, then your code would try to assign names that don't exist sometimes.

  • Use "Set Layout Scale"

    if you set it to 0.5 then you will twice as much, after a few seconds set layout scale back to 1.0

  • smallbear, I just tried your before capx and cropping worked fine for me...

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • That would be really nice, but no, that is currently impossible.

  • Nitro187, without seeing the real code it is hard to tell for sure, but it looks like the line " Player: Player = loopindex +1 //Gets the proper instance" is assigning a value to the Player instance variable, rather than "Picking" the correct instance... which would certainly give bazaar results because it would just be a random instance of Player, rarely the one you want.

    You want to use the System "Pick by evaluating Player" where the expression is "Player.Player=loopindex+1"

  • I use php a lot, and it could easily do what you want (it is not just for mySql), although it does require a web server - so I guess that is not the way for you to go.

    Keep reading through the manual - I am sure there is a fairly easy way to do it!

  • RenatoB, the reason you were seeing the correct number when you clicked on it was because you were displaying the number in the text field before you called the CheckAnswer. At that point you did have the correct instance, but then in the function it has no idea what has happened outside of the function so it just used any random instance.

    The comparing a string variable to an integer would have also been a problem... anyway, glad you got it working!   :)

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