dop2000's Forum Posts

  • I plan on using AJAX and requesting a text file, and when it is complete, read this file, and compare the text. Do you think that would not be enough?

    No, this will be quite easy to hack. Yes, it's possible to find in the source code what file you are requesting and what value you are comparing its contents to.

    So the most robust method is to read some actual data from the file, without which your game will not function properly. Like the inventory array, or some config values, or tilemap JSON etc. So even if hackers substitute or disable the file check, they will not be able to play the game without that data.

    Of course, if you are not worried about hackers and just want to be able to temporarily lock/unlock it on the server, then you can simply check if the file contains some password.

  • something that checks if a file is located at a URL (on my server in this case)

    Yes, I think this is the right way to do it. But I suggest actually reading some useful data from that file. For example, contents of some important array, used in the game. This way it will be much harder or even impossible for someone to hack your game without that file.

  • Yes, I think it's possible. I would probably do this with invisible marker sprites, green blocks on the picture below.

    Define a bunch of instance variables on markers, to store parameters of the next corner - circle radius, orbit target (circle center), orbit offset, orbit distance.

    Move the car to the first marker. When arrived, set orbit parameters from the instance variables. After the car orbited a specified number of degrees, move to the next marker and repeat.

    But for a complex track it may be easier to use some other method, like building the path with waypoints.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Here is a less mathy approach with MoveTo and Orbit behaviors.

    dropbox.com/s/657i4vzn8wratk4/RaceTrack_orbit.c3p

  • I don't know why your loop never stops, maybe you are running it on every tick? You should probably run it only once on layout start, or when JSON is loaded. There is a template in C3 which shows how to load and read data from JSON, check it out.

    Regarding images loading - each image needs to be loaded into a separate frame. So you need to create enough empty frames in the sprite, and set animation speed to 0.

    In runtime you need to create a sprite instance, set frame 0 and load image from URL. Then create another sprite instance, set frame 1 and load image. Repeat for all images in JSON.

  • el3um4s Is it ok if I put a free demo with this color picker trick on my website? I will credit you of course.

  • In Construct it's better to design all sprites facing to the right. So to mirror when it's going left do this:

    If you have more than one instance of this object, put this code inside of "For each" loop.

  • You can clamp player position - for example, on every tick set Player X to clamp(self.x, ViewportLeft("layername")+20, ViewportRight("layername")-20)

  • el3um4s wow, this is absolutely incredible!

    Where did you learn how to convert text field into a color picker?

  • You need to check Sprite.Sine.CyclePosition

    I believe it changes from 0 to 1, and values between 0.25 and 0.75 is when the sprite is moving to the left.

  • Jme7 Layout size can be changed in the editor, yes. The question was about changing it in runtime, via events.

  • If you want the camera to follow your player, add ScrollTo behavior.

    If you want to restrict player movement only to a selected area, there are many ways to do it - you can use Bound To Layout behavior, put solid wall around, or write some events which will clamp player position.

  • Yeah, using an invisible "Zone" sprite is the easiest way to do it. Here is a demo:

    dropbox.com/s/ityy4s958d14x7k/PlatformScrollZones.c3p

  • newt Calculating the average of sprites x coordinate doesn't work very well here. If you create one sprite on the left and lots of sprite on the right, the scroll will move to the right.

    You need to calculate the center point between the leftmost and rightmost sprites.

  • It's not possible. When you save the game, you need to also write a key to Local Storage, for example "GameSaved=1".

    Then you can read this key from LS to check if the game was saved.