DUTOIT's Forum Posts

  • Sorry none of your links work.

    But, this is how you do it. In the tutorial section there are a number examples on random, none duplicates using array.

    So the array randomizes pulls a number and deletes the number (so impossible to get duplicate)

    You now have a number. Use that number to get your question from txt however you do that.

    Edit: okay you put links in

    What you want is to have array for numbers (number questions you trying to randomize) have that array in a function that spits out the number, which is deleted as I said previously.

    Use that number to fetch your questions.

    Or shuffle it into array at start of game, then delete on at a time

  • No problem. Sorry I didn't give it too you straight off the bat

    Good you did a little practice.

    Reason it didn't work is cause you add 1 to totalvalue when you needed to add total of each current value and not 1

    I see I typed that too, so my bad, but I was doing it out of head - lol.

    Anyways, functions are great. Now learn how to pass info via param and that single function could possibly find total stars, stars for specific level, etc etc etc

    Functions are most powerful part of C2.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Here you go

    Did this quick.

    Used function, with local variables

    Stores Total stars in global variable totalstars... so just display it where you want. or look at it in debugger to see it in action.

  • filechooser?

    [quote:39gjhf3s]Using files

    Once a file has been selected, it can be accessed using a URL. While many URLs reference web resources on the Internet, the File Chooser plugin returns a special URL that refers to the local file. This URL typically starts with "blob:" (since the browser's term for an arbitrary set of data is a "blob") followed by some kind of unique ID. By accessing this URL the local file is accessed, without using any Internet connection, so this also works offline.

    The file URL can be used like any other URL. For example, it can be requested by the AJAX object to load its contents as text, or passed to the Sprite object's Load image from URL action to display it.

  • All cards are practically the same, except the copy on them and a few images specific to the card.

    You need a card.

    You need the info to populate the card and load in some custom image (character portrait).

    And you want user to customize it....

    Text file or json (both are easier than xml)

    Text use tokenat or regex

    json load into array or dictionary

    I know c2 can load images in, they just need a url which can be stored with all the data in text or json.

    Not sure if you can include from folder, but you can have user pass a url via his text/json file.

    Edit: I am talking from not actually having done this to such a degree

  • Use 1 sprite with each frame being a fish. Put instance variables in sprite of fish.

    Now compare sprite against sprite... works same as family, except restrictive to 1 type of something.

    Now compare fish with fish

  • Can use pick ...

    Can use foreach text....

    Can use text with condition campare two put in text.uid = xyz

    etc

    many ways to peel a banana.

  • Foreach creates a loop that goes round and round for each x element it cycles through each line in the array.

    Condition allows us to restrict amount of lines/loops to a specific rule

    Our rule is x must be greater than 2

    Why 2?

    Because tutorial says if player attempts level he gets a 1, if he wins the level he gets a 2, if he wins and gets 1 star, he gets 3, wins and 2 stars, he gets 4 and if he wins and gets max stars he gets 5

    Its just a number.

    We know that 2 of the 5 is not stars so we want to subtract the 2 to get the remainder.

    Examples

    x = 3 player has 1 star 3-2=1

    x = 4 player has 2 stars 4-2=1

    x = 5 player has 3 stars 5-2=3

    So we loop through each x element that is greater than 2

    We add total x number to a total variable

    we also add 1 to count number of times it cycles (this is number of x entries that have stars.

    No we do the same. Total -2 = stars but I did it a litle different

    Total - (numberlevelswithstars*2)

  • Amount of stars...

    Okay found tutorial.

    So he stores data as follows

    finish level = 1

    win = +1

    star1 = +1

    star2 = +1

    star3 = +1

    So if a player finishes level and wins and gets 3 stars x = 5

    So you want to for each x element

    you want to add a condition curent value > 2 [Don't want to count levels without stars]

    System add 1 to TotalStars (variable)

    Sytem add 1 to NumberStarLevels(variable)

    outside loop

    System Subtract Totalstars numberstarlevels*2 [because we want to remove the 2 in each]

    The above isn't pretty. But I am trying to show you the logic.

    Foreach x.

    Condition that x > 2 (2 being player has won, but no stars)

    We want to add all those up.

    Now we want to subtract the finish 1 plus the winning 1 to get total stars

    You can see this all clearly using the debugger

  • For each X element

    add x to a variable (local or global)

    outside loop

    set text.text to variable or something

  • Photon scales to 1000's of concurrent connections... at a price, which is pretty reasonable considering the hardware server you may need to get same.

    They manage everything.

    The plugin has everything you will need. and they offer tons of documentation so you can write your own.

    Do it yourself vs 3rd party.

    If you are super savvy and are a wizz with servers etc then Socket.IO plugin might be better.

    But, if you would rather run a business, build a game and not spend all your time fine tuning a server etc, then photon is better choice.

  • Photon works very well. They also have a plugin here to make the set up easy.

    The free account is really only for testing.

    The price tier isn't too bad either, that is if you can monetize your game.

    I've tried all available options currently, and think they are the best at the present moment.

  • What briggybros said.

    I have designed full games and tried to implement multiplayer which resulted in a headache. Best to start with multiplayer and built on top of each milestone, stacking, testing etc.

    Multiplayer, isn't as straightforward and flexible, unless special care has been taken in structuring your game accordingly.

  • Quenntinne,

    No problem. I would recommend you do the examples I told you about. Open C2, hit file. new and work your way through them. You will learn tons and tons

  • Like a phone screen, swiping sideways to get to next screen?