AlphaCharlie's Forum Posts

  • 13 posts
  • SOLVED!! I changed all my choose() values to 1.001, 1.201, etc, then used this formula to grab 2 decimal places:

    left( str(<the choose() number>), find( str(<the choose() number>), ".")+3)

    Thankyou Dan72 and this post:

    Cheers - AC

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • But it displays "1" instead of "1.00" and "1.2" instead of "1.20", etc. Grrr.

  • It was too hard! I used this instead:

    choose(1.00,1.05,1.10,1.15,1.20,1.25,1.30,1.35,1.40,1.45,1.50,1.55,1.60,1.65,1.70,1.75,1.80,1.95,2.00,2.05,2.10,2.15,2.20,2.25,2.30,2.35,2.40,2.45,2.50,2.55,2.60,2.65,2.70,2.75,2.80,2.95,3.00,3.05,3.10,3.15,3.20,3.25,3.30,3.35,3.40,3.45,3.50,3.55,3.60,3.65,3.70,3.75,3.80,3.95,4.00,4.05,4.10,4.15,4.20,4.25,4.30,4.35,4.40,4.45,4.50,4.55,4.60,4.65,4.70,4.75,4.80,4.95,5.00,5.05,5.10,5.15,5.20,5.25,5.30,5.35,5.40,5.45,5.50,5.55,5.60,5.65,5.70,5.75,5.80,5.95,6.00,6.05,6.10,6.15,6.20,6.25,6.30,6.35,6.40,6.45,6.50,6.55,6.60,6.65,6.70,6.75,6.80,6.95,7.00,7.05,7.10,7.15,7.20,7.25,7.30,7.35,7.40,7.45,7.50,7.55,7.60,7.65,7.70,7.75,7.80,7.95,8.00,8.05,8.10,8.15,8.20,8.25,8.30,8.35,8.40,8.45,8.50,8.55,8.60,8.65,8.70,8.75,8.80,8.95,9.00,9.05,9.10,9.15,9.20,9.25,9.30,9.35,9.40,9.45,9.50,9.55,9.60,9.65,9.70,9.75,9.80,9.95,10)

  • Thanks I want to use the second method, but it still genarates numbers like this: 5.812518740331899, using this formula: ((random(100,1000)/5)*5)/100.

    Cheers - AC

  • Hi.

    I am creating a game to help my son with money / change. I want to generate a random total for the 'shopping' between $1.00 and $10.00. The generated value must have a 5c resolution, i.e. $2.75, $6,20, etc. Something like $4.22 would not be valid. The aim is to pick from currency images to create the correct change.

    It has been a while since I did any dev, so I am struggling with the structure of the required random() function.

    Thanks - AC

  • Thanks for the replies. I managed to use animation frames for each different image, and it's working nicely.

  • Ah! Thanks for that In your example, would I need 3 sprites, each with 3 animation frames, or a single 'container' sprite with 3 animation frames that I spawn programatically (rahther than just make visible )?

  • Hi. Do you mean set each animation frame as a completely different image and display the frame based on the random number? So, for example, have frame 1 as an apple, frame 2 as a banana, etc, then if the random number =2, then display the sprite with animation frame 2? I assume the loop property would be disabled?

    How would I determine which object was selected in that case?

  • Hi.

    I am developing a game that will involve selecting objects that begin with a certain letter. I want to firstly display a sprite with a letter (say A - C), based on a random number, (i.e. if the random number=1, then display the 'A' sprite, if it = 2, then display the 'B' sprite, etc.).

    Once that is done, then display some sprites. I had thought I would use a 2 dimensional array to store the sprites (or their names), where the X value would be the letter, and the Y values would be the object / sprites / sprite names. I would need to keep track of what was loaded to the layout, so I could ensure the loaded sprites were able to to be moved, etc.

    Is this possible, or is there a completely different (better) approach.

    Thanks - AC

  • Thanks again mate!

  • Well, after a few version updates, for various other reasons, the ads are showing, but with strange behavior. What I want to do now is remove the intersitial layout I created, and simply perform an AdmobAds.showintersitial in the 'on start of layout' event of the game over layout. I am wondering what would happen when the ad is dismissed. Would the layout then continue, or would I end up in a black hole?

  • Thanks Yes - I am using the cranberry plugin in Intel XDK. I am trying to update my game in the play store (that was interesting in itself...), so I will see how that goes. From what I have read (a lot of reading!), if you see the test ad, everything *should* be working. Maybe it's a matter of creating a new ad unit and using it's associated ID and seeing if that works.

    Cheers - AC

  • Hi. First timer here...

    I have created a game, and on game over, I show a new layout to display an intersitial admob ad. Firstly, is this the right way to do it (i.e. new layout just for the ad), and secondly, I exported from C2 with test mode=false, did everything right in Intel XDK, set the ad unit up correctly in Admob, but all I see are the test ads. Any ideas? I have double checked there are no sneaky leading or trailing spaces in the ad ID is C2.

    Thanks - AC

  • 13 posts