Difference between 1 and 11 ?

deviliosdevilios Member Posts: 16
edited November -1 in Working with GS (Mac)
Hi,

I'm making a game but i have a little problem. I made a question spawner like : 5+4 = and if i press 9 it's says congratulations ... so it's ok.

The problem is : if the question is 11 i can't press 1 two times.

Someone can help me ?

see ya

bob

Comments

  • calvin9403calvin9403 Member Posts: 3,186
    make a button call 11

    _________________________________
    http://www.gamesaladforum.com/
    http://gshelper.com/
  • deviliosdevilios Member Posts: 16
    yeah but if i want to make a game with 99 buttons it's gonna be very hard to understand my game :P
  • calvin9403calvin9403 Member Posts: 3,186
    why can't you press 1 two times?

    _____________________________
    http://gshelper.com/
    http://www.gamesaladforum.com/
  • simo103simo103 Member, PRO Posts: 1,331
    I believe you are going to have to add an equals button or Answer and then you are going to need attributes to capture the max number of numbers (ie: if 99 then you need two attributes plus an answer attribute). One for the tens and one for the singles.

    Answer attribute equals attribute Tens plus attribute singles.

    First number pressed can be assigned to the Singles. If equals/Answer pressed then compare Answer with spawned number. If number pressed again then tens equals singles times ten and singles equals the new number.
  • deviliosdevilios Member Posts: 16
    hi,

    thanks for your answer but i'm new with gamesalad so it's quiet hard :P

    My games works perfectly with a random(1,9) i made 2 attributes

    1) number
    when touch 1 is pressed then game.number = 1
    when touch 2 is pressed then game.number = 2
    ...

    2) question change attribute game.question to random(1,9)

    finally

    when game.question = game.number then display text : "congratulations " You think your method could work ?

    See ya Bob
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    Hi devilios; maybe consider a small number pad with an enter button?
  • ApplaudAppsApplaudApps Member Posts: 308
    Have a timer on the answer so that after the first key press wait 3 seconds then accepts the answer, then you could program it so the player can enter two or three keypresses (resetting the timer each time) and you'll have to make it so it adds up the total correctly e.g. first keypress x 10 + 2nd keypress.

    Just a thought - it seems clear in my head! ;)

    ____________________________________________________________________

    Music for your Games
    Track #1 for sale - 33% off
  • deviliosdevilios Member Posts: 16
    Hi,

    thx for your answer. I'm trying your solution but i don t know how to proceed...

    especially with this function
    first keypress x 10 + 2nd keypress.

    I made a small number pad and when i press a button : the attribute's value changes like if i press 1 the value of the attribute is 1.

    So... with your solution :

    when actor receives event touch is pressed
    change attribute

    change attribute : game.number to (for example 1)
    Where do you put your function first keypress x 10 + 2nd keypress ?

    And my rule to show the answer is :

    when attribute game.question = game.number

    display text

    text: game.number

    I really don't understand maybe because i spent my all day on this function :P

    see ya

    Bob
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    on the 1 button have a rule that says when touched change self.TimesTouched to self.TimesTouched+1

    then change game.answer to ((selfTimesTouched-1)*10)+1
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    I would also search for the keyboard demo by FMG. That should help a lot with setting the different digits.
  • simo103simo103 Member, PRO Posts: 1,331
    Did you solve this issue? I wanted to challenge myself a bit so I made a quick Simple Calculator that I think will do what you want and/or provide you with some stuff you can use. Search for it in the Creator+NEW section and double click to open.

    Note: I have the Equals button reseting everything to zero after 3 seconds so you can try various combinations to see it work.

    Hope it helps.
  • deviliosdevilios Member Posts: 16
    hi,

    I tried your method scitunes but nothing happens ... i'm still looking for a solution :P

    thx

    see ya

    bob
  • simo103simo103 Member, PRO Posts: 1,331
    devilios said:
    ... i'm still looking for a solution :P

    see my post above yours ... I uploaded a template for you.
  • deviliosdevilios Member Posts: 16
    thanks i'm searching your app.
  • deviliosdevilios Member Posts: 16
    Hi,

    I can't load your game. I tried the others and they are working. Can you send me the game or have you an other solution ?
    I tried to load the game with 2 macs.

    See ya and thx

    bob
  • simo103simo103 Member, PRO Posts: 1,331
    Did you 'Search for it in the Creator+NEW section when you open GS .... and then double click to open.'? It is called Simple Calculator.

    Does anyone else see it and can verify it can be downloaded?
  • deviliosdevilios Member Posts: 16
    the app charges and after the screen is black
  • simo103simo103 Member, PRO Posts: 1,331
    I believe you are looking at it in the browser through this website.

    You need to open GameSalad Creator (the program you use to make games). Once opened go File>New and use the search box the has 'Filter' in it. type in Simple Calculator .. wait ... wait a bit more. Then it will come up. Double click your mouse on the icon that says 'How to by simo103' (make sure you Double click) .. and it should open the project on your computer. You can then go File>Save and save it to your Mac. Then poke around ... it should work fine if you are on the latest GS version.

    (Also please someone else let me know it works so I know the file is okay and that I'm not wasting devilios' time ..thanks)
  • deviliosdevilios Member Posts: 16
    OMG

    thanks so much it's just what i wanted !

    thanks

    see ya

    BOB
  • deviliosdevilios Member Posts: 16
    devilios said:
    OMG

    thank you so much it's just what i wanted !

    thanks

    see ya

    BOB

  • simo103simo103 Member, PRO Posts: 1,331
    no problem ... if that is your first time finding stuff that way ... you have just found treasure ... there are hundreds of helpful templates you can search for and use in there.
  • StuartYStuartY Member Posts: 134
    I wouldn't be this facetious if you hadn't already got some good advice - but when I first saw the title of this thread, I immediately thought "normally it's about 10."
Sign In or Register to comment.