andreyin's Recent Forum Activity

  • andreyin

    I've done quite a bit with Chinese in Construct.

    Are you going to use a sprite font? Because that's the only text type object that supports custom widths for each character like a space with "0" width. If you do, your font is going to be HUGE unless you're implementing a very limited subset of Chinese/Japanese.

    Yep! Someone helped me out translating my game to chinese, and they also made a list of all the characters used, so it's fine though. Here's a picture of what the sprite font looks like if you're curious:

    Thankfully my game isn't text-heavy, so it's fine. The solution I mentioned worked just fine, it was a bit annoying to space out all the characters in the game text but it's working out great!

  • Hello,

    Currently I'm implementing Chinese characters into my game, and I ran into this problem - when you write in Chinese (and in Japanese I think?) you don't space out the characters, so I would have to set the wrapping option of my sprite text to "character". So far so good, but my game also uses other latin languages, and it just looks plain ugly when the wrapping is set to "character".

    I already though of a "hack" of sorts - I'm thinking of having a "space" character set to 0 width, and add it in between every Chinese character that's in the text. It's quite a big hack so I decided to ask first if implementing something like this in C2 would be possible before actually doing it...

    Thanks!

  • I used a similar code for one of my games:

    http://gamejolt.com/games/adventure/arc ... ndy/31814/

    And it works as intended...

    Edit: my bad, I took a look at the code and instead of checking "gamepad 0 left analog Y axis > 0: move down" I'm using "gamepad 0 left analog Y > 20: move down". I think I had a similar problem so instead of using the gamepad object's deadzone I change the 0 to 20. Up would be "gamepad 0 left analog Y < -20" for instance...

  • Problem Description

    Global objects cannot be save stated.

    Attach a Capx

    https://dl.dropboxusercontent.com/u/238 ... jects.capx

    Description of Capx

    Run the .capx and press OK to go to the next layout. Press OK again to load the state created when you first started the game, then OK once more to go to the second layout one more time - the global sprite that was there before is gone.

    Steps to Reproduce Bug

    • Create a global object on a layout that's not the first one (apparently it works just fine if the global object is in the first layout)
    • Save state the game
    • Load the state

    Observed Result

    Global object is not loaded, nowhere to be seen.

    Expected Result

    The global object should be on the same position it was when the state was saved.

    Affected Browsers

    • Chrome: YES

    Operating System and Service Pack

    Windows 8.1

    Construct 2 Version ID

    r198

  • RenatoB

    IIDs are only for the same object - UIDs are for all the objects from the entire game.

    Yeah, you could make something like "on start of layout -> for 0 to 3 -> Create Sprite at random positions -> Set sprite frame to (loopindex)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • RenatoB

    When you "append" something to a text object, it will add what you want after the current text.

    If you have a text object with "Hello" written on it and append " world" after it (with the space), you would get "Hello world".

    If you have a text object with "Hello" written on it and used SET TEXT with " world", the text would erase and become " world".

    The sprite IID is the instance ID that it has when it's created. If you notice, all the sprites with numers are the same sprite, just with different animations. When the game starts it loads these sprites one by one, and each one has a single IID, from 0 to 3. The str() expression converts this number into a string, and the append adds it to the text object.

  • I made a little prototype for you:

    https://dl.dropboxusercontent.com/u/238 ... order.capx

  • Well, for starters, your game is currently running in 1080p... and you're also using the "High Quality" fullscreen scaling option, so that might be it maybe?

    I have a Moto G and I have tested a game I made using CocoonJS, the game resolution is 720p and there's a WebGL effect that keeps changing the hue every second... and it still ran OK. (around 50-60fps I believe).

    edit: by the way, I'm not sure what is supposed to be happening in the game, but if by "slow" you mean that the ball is falling down too slowly, you just have to change the gravity of the platform behavior on it... and you can also use "simulate control left" and "simulator control right" instead of setting the ball's position to X+dt*200..

  • First, keep in mind that the random() expression picks a random number - if you input something like random(1) it will pick a number between 0 and 1 (like 0.222, 0.784, etc).

    If you read the expression like it was a math problem, you'll understand better.

    What happens first is that a random number is generated between 0 and 1 - then this number is multiplied by 4.

    Let's say the random number is 0.7!

    0.7 * 4 = 2.8, right?

    Then we have floor(2.8+1). So of course, 2.8 + 1 becomes 3.8, right?

    Then there's the floor() expression that is used to round down a number. If you use floor(3.8) it will round it down to 3.

    So, what the code is saying (in this example) is that the game should go to Layout "Lvl 3" - the & is used to append text (in this case, the "Lvl " text to the "3" number", becoming "Lvl 3".

    There are multiple ways you could do this. Check out the expression page for more expressions like that:

    https://www.scirra.com/manual/126/system-expressions

  • I tested it here and the .capx is running fine.

    Did it crash like that on older C2 versions also? How much RAM have you got?

    What did happen here is that C2 took a while to load your game because there are like 20 tabs open at the same time...

  • andreyin - any chance the code from blackhornet is posted on the forum? I couldnt find anything.. Thanks!

    Probably this one:

    Yes, that's exactly it!

  • Phew, thanks! I seriously thought that I would have to rewrite the entire thing and that I was the one messing it up haha. Cheers!

andreyin's avatar

andreyin

Member since 11 Jan, 2010

Twitter
andreyin has 1 followers

Connect with andreyin

Trophy Case

  • 14-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • x3
    Great Comment One of your comments gets 3 upvotes
  • x2
    Delicious Comment One of your comments gets 10 upvotes
  • Email Verified

Progress

21/44
How to earn trophies