Maverick1912's Recent Forum Activity

  • Use choose("car", "truck", "bus") & ".png" in your URL.

  • Why don't you make it with revert way?

    - You have the name of the png.

    - Have variable call nameOfImg.

    - Load Image from URL with the path is nameOfImg&".png"

    - Then you display the nameOfImg in text.

    - And the nameOfImg can be random like choose("dog", "cat").

  • When you run in debug mode, you will see the array only has 1:

    x: ,,,,,

    y: all you rgb

    You must edit your JSON file.

  • You can make a parser to do it. There are many ways to do that depending on what you want to do.

    Fist step is to get a list of tokens (numbers and +- or ^)

    A simple way to do that is with a series of replaces so what you end up with is a list of tokens divided by spaces.

    Then you can loop over them and make that substitution with something like this:

    var text = "2^3+4^6
    
    Set text to replace(text, “ “, “”)
    Set text to replace(text, “+”, “ + “)
    Set text to replace(text, “-“, “ - “)
    Set text to replace(text, “^”, “ ^ “)
    
    var output= ""
    var i=0
    var n=tokencount(text, " ")
    
    while i<n
    -- add 1 to i
    -- if tokenat(text,i," ")="^"
    -- -- add "pow("&tokenat(text,i-1," ") &","&tokenat(text,i+1," ")&")" to output
    -- -- add 2 to i
    -- else
    -- -- add tokenat(text,i-1," ") to output

    Thanks R0J0hound!

    As I understand that with your script it would work with numbers have 1 character.

    But it is a good start for me. :)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I was curious why the .pow format? Set text to str((2^2)+(2^2)) displays 8.

    Thanks for your answer!

    I have an input for users can input the numbers and operators to create a math string as a calculator.

    Then users press "=" to show the result.

    I use Math.pow(x,y) because the eval(string) in JS script does not give the correct result if there is a "^".

    But I would try your way to convert the math string and put in the str().

  • Hello,

    I have an example math string like this:

    4^5 + 3^2 + 6 - 2^3

    Then I would like to convert it to:

    Math.pow(4,5) + Math.pow(3,2) + 6 - Math.pow(2,3)

    I tried to break them with "^" and put in array then combine head and tail for each power but everything leads to dead end.

    Appreciate with any idea ^_^

    Tagged:

  • You do not have permission to view this post

  • Set a variable as index of the array.

    Then when you load image, load sprite with arrayIndex&".png"

    Pressing Previous button to subtract and Next button to add to the arrayIndex.

    You must compare the arrayIndex with 0 and 1499 to know the limit when subtract or add.

  • Thank you oosyrag !

    I'm practicing with the Bluetooth example and plugin to figure out what I need.

  • Hello everyone,

    I wonder that if there is any chance to send actions between 2 devices that connected through bluetooth.

    Like I can control a game on other device with another device has virtual gamepad.

    Appreciate for your help!

Maverick1912's avatar

Maverick1912

Member since 13 Nov, 2014

Twitter
Maverick1912 has 17 followers

Trophy Case

  • 10-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • x8
    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
  • Enduring Visitor Visited Construct.net 90 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

18/44
How to earn trophies