Newbie in need of direction for Math Game

Hi, I’m totally new to programming more into graphics design…anyway now that I have a kid of my own, I would like to create a math game for my kid to play with. Have search the forum found many with the right formula. But I would like to create one of my own, something “daddy” made.

I just need some pointers in the right direction.

Basically a screen displaying a sum as digit or objects(apples,cars etc) depending on the lvl. and the user select the correct answer.

Tutorial/template or anything is welcome. I want to learn how to do it. 

This is more a personal project.

Any help is appreciated 

Thank you

Frans

Afternoon,

http://numbertap.net/

Kan anyone give me some insight what functions where use to display the digit/sums?

Appoligy if my question are stupid or not to the point.

Kind regards

Frans

most of what i see in numbertap is pretty simple.  all of your keys can be done graphically and assign each key a ID  and a event listener.

[lua]

    homeIcon = display.newImageRect( “images/common/back1.png”, 145, 145,true )  – 145,145 is the x and y of the graphic

    homeIcon.x = (homeIcon.width/2)+(200) – image displays off the centerpoint by default

    homeIcon.y = ((homeIcon.height/2))+(200)

    homeIcon.alpha = 1

    homeIcon.ID = “key1” – Self assigned key ID to be used in the listener

    homeIcon:addEventListener( “touch”, buttonAction )

[/lua]

So make one of those for each key they will press.

here is a event listener to use with it

[lua]

function buttonAction(event)

    if event.phase == “began” then

      if event.target.ID == “key1” then

        – Do something for key1 on the began phase of the touch evennt. like show a highlight color

      end

    end

    if event.phase == “ended” or event.phase == “released” then

      if event.target.ID == “key1” then

        --Do something when they release the key.  this is where you would determin if you want to show what they hit or add a value to something else…  

      end

    end

end

[/lua]

you can render the math problem  itself with just a display text option as well with something like this:

[lua]

    local textToDisplay = “hello there”

    local line1a = display.newText(textToDisplay, 1,1, “Helvetica”, 48 )

    line1a.x = 100

    line1a.y = 100

    line1a:setTextColor(255,255,255)

[/lua]

and after you display the text, if you want to change its displayed value later (after they hit a key)

[lua]

  line1a.text = “new text to display” – and it will update the text its displaying 

[/lua]

Thank you m8, will take what u have given and analyze it. First time ever programming. I would prolly have to give the text that i’m outputing a value? 

Kind Regards

Frans

Afternoon,

http://numbertap.net/

Kan anyone give me some insight what functions where use to display the digit/sums?

Appoligy if my question are stupid or not to the point.

Kind regards

Frans

most of what i see in numbertap is pretty simple.  all of your keys can be done graphically and assign each key a ID  and a event listener.

[lua]

    homeIcon = display.newImageRect( “images/common/back1.png”, 145, 145,true )  – 145,145 is the x and y of the graphic

    homeIcon.x = (homeIcon.width/2)+(200) – image displays off the centerpoint by default

    homeIcon.y = ((homeIcon.height/2))+(200)

    homeIcon.alpha = 1

    homeIcon.ID = “key1” – Self assigned key ID to be used in the listener

    homeIcon:addEventListener( “touch”, buttonAction )

[/lua]

So make one of those for each key they will press.

here is a event listener to use with it

[lua]

function buttonAction(event)

    if event.phase == “began” then

      if event.target.ID == “key1” then

        – Do something for key1 on the began phase of the touch evennt. like show a highlight color

      end

    end

    if event.phase == “ended” or event.phase == “released” then

      if event.target.ID == “key1” then

        --Do something when they release the key.  this is where you would determin if you want to show what they hit or add a value to something else…  

      end

    end

end

[/lua]

you can render the math problem  itself with just a display text option as well with something like this:

[lua]

    local textToDisplay = “hello there”

    local line1a = display.newText(textToDisplay, 1,1, “Helvetica”, 48 )

    line1a.x = 100

    line1a.y = 100

    line1a:setTextColor(255,255,255)

[/lua]

and after you display the text, if you want to change its displayed value later (after they hit a key)

[lua]

  line1a.text = “new text to display” – and it will update the text its displaying 

[/lua]

Thank you m8, will take what u have given and analyze it. First time ever programming. I would prolly have to give the text that i’m outputing a value? 

Kind Regards

Frans

Greetings,

I’ve been struggling with this for some time. Can anyone point me in a direction where I can get a template/sample of this kind of mechanical.

Apology if I sound “lazy” just be more easier for me to see an example to analyze and learn from.

Thanks

Greetings,

I’ve been struggling with this for some time. Can anyone point me in a direction where I can get a template/sample of this kind of mechanical.

Apology if I sound “lazy” just be more easier for me to see an example to analyze and learn from.

Thanks