dop2000's Forum Posts

  • Use Anchor behavior for UI objects.

    Usually you target one resolution (for example 1280x720) and one aspect ratio (in this case 16:9). You design the entire game for this resolution. On bigger screens everything will be automatically scaled up, on smaller screens - scaled down.

    To support different aspect ratios (for example 4:3), you need to use Anchor and make your backgrounds bigger. You might also need to make other adjustments with events, but this depends on the game.

  • Use Scale Outer, enable Unbounded scrolling on the layout, and make backgrounds about 20% bigger than the viewport size, tutorial:

    construct.net/en/tutorials/supporting-multiple-screen-sizes-77

    Demo:

    dropbox.com/s/vjyximq2059wbvt/ScaleOuter_demo.c3p

  • Well, simply don't reset lives variable when entering level 2.

  • There are several ways to do this, depends on the complexity of the game and your programming skills.

    1. You can do this with variables and layouts. Each location will be a separate layout and you can add an invisible object (sprite) LocationInfo with a bunch of instance variables, which will contain all the data required for this location. So, when player goes to a new location, on start of the layout you read variables from LocationInfo sprite and change music, display messages etc.

    2. You can store all the data in one of several text files, which can be in XML, JSON, CSV or your own format. When changing location, read the file for this location and load the data from it. Take a look at this post to see how it can be done with XML. Also, check out the tutorials section:

    construct.net/en/tutorials

    PS: Not all tutorials are good. This one demonstrates how text adventure games should not be made. Hard-coding everything in events is a bad practice and I don't recommend it.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 1st layout - why do you loop to array.height? I don't know your array structure, but it's usually array.width. Also, when you are loading multiple images into one sprite, you need to load them to different frames. Otherwise all sprite instances will have the same image. So you create a sprite, change its frame, and then load image.

    2nd layout - after you switch to another layout, "hm" sprite is no longer available. Even if you set it as Global, this layout doesn't know which sprite was tapped. So before changing layouts you need to save hm.Qname in a global variable and then on start of the second layout use that variable to request a file with AJAX.

    .

    You need to start using debugging tools. Run the game in Debug Mode, you will be able to see the array content, how many hm sprites are created, instance variables for these sprites etc.

    Also, use "Browser Log" to output debug messages. For example, after "AJAX request hm.Qname" add another action:

    Browser Log "Requesting filename: " & hm.Qname

    Then run the project, press F12, open Console and see what happens.

  • Check the origin point position in the progress bar sprite. If you want it to grow from left to right, than Origin image point needs to be set at X=0.

  • Your link still leads to the same old version of the project.

    The problem with your animations may be with the collision polygons. If polygons are different in different frames/animations, this can trigger events like "On fall" at the wrong time. It's recommended to have the same collision polygon in all frames, or use a separate sprite with Platform behavior.

  • ..................
    	Function call "CreateObjectByName" (parameter: "Zombie")
    
    
    On Function "CreateObjectByName" 
    	System create object by name Function.param(0) 
    

    You can also add all such objects to a family and use "System Pick last created Family" event, if you need to change some other properties of the created object.

  • Where did you see "loopindex" in my comment??

    Change all Touch.X with Touch.X("UI")

    Change all Touch.Y with Touch.Y("UI")

    Everywhere, in all formulas!

  • Your layers have different parallax. Try replacing Touch.X with Touch.X("UI"), same for Touch.Y

    Here is a demo:

    dropbox.com/s/7p6fgru06zrzvpj/Thumbstick8Direction2.capx

  • Yes, probably. How are you creating them now?

  • When you create random images for different quizzes on the layout, you can also set a corresponding file name with quiz questions for each sprite (add it to an instance variable "quiz_file_name"). Then on tap you can simply request Sprite.quiz_file_name with AJAX.

    I'm not watching a 24-minute video of some guy typing in Notepad, sorry :)

    Please post your project.

  • jigwe976035 There is a demo project in Construct, which demonstrates how to use Local Storage.

  • Instead of "AJAX request project file" use "AJAX request URL", where URL is the file name. So you can change your code like this:

    Touch On Tap gesture on Sprite 
    	Sprite animation frame=0 : AJAX request URL "quiz0.json", tag "quiz"
    
    	else
    	Sprite animation frame=1 : AJAX request URL "quiz1.json", tag "quiz"
    
    	else
    	Sprite animation frame=2 : AJAX request URL "quiz2.json", tag "quiz"
    
    

    Instead of animation frame you can use some other condition, or even an instance variable on the Sprite containing the file name string.

  • Are you sure you posted the correct file?

    1. I don't see any events that are supposed to change animation. Try something like this (screenshot from someone else's game):

    2. I couldn't find the way to die on first level. I think the problem is that you are not resetting "lives" variable. Also, you set layer 1 visible, but your "level failed" is number 3. I always recommend using layer names instead of numbers, this way when you add more layers in the future, you'll not have to change events.

    3. You have "Letterbox Integer" scaling mode set in project properties, try different scaling modes. Tutorial:

    construct.net/en/tutorials/supporting-multiple-screen-sizes-77