dop2000's Forum Posts

  • You can get something similar (but not exactly what you described) with this formula:

    round(random(10)*random(10))

    For a much "steeper" results you can do this:

    round(random(1)*random(1)*random(1)*100)

  • Maybe he meant "purchased", not "published"?

  • You can't disable/enable event groups if something changes about individual NPC instances.

    When one NPC sees your character, you are disabling "eNPC Basics" and "eNPC States" groups. This affects all other NPCs! So this approach is completely wrong.

    Use instance variables, use For Each loops, different timers. But don't disable groups.

  • What are you talking about? Which objects, what actions? There are hundreds of events in your capx, what exactly should I look at?

    Edit: Ok, I see red NPCs. So what's wrong with them? Could you elaborate?

  • The system only checks for collisions when it's needed - if you have events "On collision" or "Is overlapping" or if there are behaviors on the objects that register collisions (platform, physics etc.)

    So normally your destroyables should not generate collisions check with the walls.

    You said your layout is (1400,800) - is this in pixels or is this the number of tiles on the tilemap?

    If in pixels, it's not that big and you should be able to use tilemap or even several tilemaps on top of each other.

    If you have lots of individual sprites like destroyables, you can disable/enable collision for them if they are too far from the character or in another room etc.

    System-> Pick by comparison-> Sprite where distance(Sprite.X, Sprite.Y, Character.X, Character.Y)<100 : Sprite Set collision enabled

    System-> Pick by comparison-> Sprite where distance(Sprite.X, Sprite.Y, Character.X, Character.Y)>=100 : Sprite Set collision disabled

  • Top number on your left image should read "-90" or "270".

    I don't really understand what your problem is. If you are trying to increase the angle by 90 degrees (or rotate it 90 degrees clockwise), you can simply add 90.

    Set Sprite angle to (Sprite.angle+90)

    This might give you a result which will be greater than 360, but the system will convert it to correct angle.

    Or you can use anglerotate expression:

    endAngle=anglerotate(startAngle, startAngle+90, 90)

  • There are a few expressions related to angles:

    angle(x1, y1, x2, y2) Calculate angle between two points

    anglelerp(a, b, x) Linearly interpolate the angle a to b by x. Unlike the standard lerp, this takes in to account the cyclical nature of angles.

    anglediff(a1, a2) Return the smallest difference between two angles

    anglerotate(start, end, step) Rotate angle start towards end by the angle step, all in degrees. If start is less than step degrees away from end, it returns end.

    You're probably looking for anglediff, although you should know that it always returns positive result. I.e. anglediff(10,50) returns 40, and anglediff(50,10) also returns 40 (not -40).

    Also these system events may be useful: "Is between angles", "Is within angle", "Is clockwise from"

  • Oh, so you are using some external "HTML" plugin, like this one?

    I don't know anything about this, sorry. Maybe you can disable resizing with CSS, or if you know javascript you can try to change this in plugin source code. Or try another plugin, I think I've seen a few similar ones (for C2 at least).

  • Could you explain in more detail what are you trying to achieve?

  • If a variable is only used in events from one group, you should consider moving this variable to this group. This helps to de-clutter your project. Local group variables are only accessible by events in this group.

    You should be aware, that local group variables are reset between calls. So it's not a good idea to put a variable like GameScore in a group, because it will reset to default value all the time.

    If you want your Local variable to keep its value, you need to change its type to Static. The problem with Static variables though is that if you need to reset them, you'll have to do it for each variable ("System Set GameScore to 0"). Unfortunately, there is no "Reset all static variables" action in C2.

    Same rules apply to local variable defined inside of events.

    As far as I know, "Include" does not have effect on Global variables. Global variable defined in one Event sheet is visible to the entire project, no matter if this event sheet is included into other event sheets or not.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Don't use Button or other form controls. They are not "native" to Construct, there are lots of issues with them.

    They may be ok for some types of games like quizzes, but I wouldn't use them in a platformer.

  • So you want your character to be always in the center of the screen? Simply add ScrollTo to your character then.

  • I'm not sure if this a good method, but it seems to be working:

    Create an object (sprite for example), set Global=Yes, add NoSave behavior to it.

    Add instance variables that will store the items you bought. When player buys something in the shop, put it in these instance variables.

    In "On Load Complete" event read these variables and add the items to player's inventory.

    Or I guess you can do this with Local Storage. When exit from the shop, write all inventory into the local storage.

    In "On Load Complete" load inventory from the local storage.

  • robotpencil I think you can do the same with 8-Direction. Disable standard controls, set acceleration=10000, deceleration=0, On key pressed simulate controls.

  • There was something wrong with your project, some bug maybe. I created a new project with the same Physics movement and scrolling and couldn't reproduce the jittering.

    So yeah, use 8-Direction and everything will be fine.