AllanR's Recent Forum Activity

  • jasskr

    I remembered reading about why they needed to move it for the C3 runtime, but can't remember where I saw that now...

    any way, I found it - you have to add "Platform Info" (in the "Other" section). Then you can check if "Is on mobile".

  • Try Construct 3

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

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

    well, one way to do it is to test if the mouse is moving.

    I gave the paddle an instance Variable MouseLastX. If that isn't equal to the current Mouse.X then you know the mouse has moved, update the instance variable and set the paddle location.

    so, if the mouse isn't moving, the paddle wont either... unless you use the arrow keys. Just be careful to not bump the mouse :) You might want to give the player a choice before the game starts though. (I added touch support as well just for fun).

    https://www.rieperts.com/games/forum/Paddle_controls.capx

  • derboo

    Scale Inner will show as much of the layout as it can without ever showing anything outside the layout.

    So, when a device can't show the full layout it will be centered by default.

    You just have to set scroll Y to the bottom of your layout.

    There are a few other things to watch out for... if you are manually positioning objects, it takes the browser about 0.1 seconds to figure out what its dimensions are. (after that, the dimensions don't change unless you trigger the "Browser - On Resized" event... then you have to Wait 0.1 seconds again.)

    You can also use the Anchor behavior to position objects - they will stay in a relative position to the edges they are anchored to...

    I made a quick sample which works on my iphone, ipad and desktop:

    https://www.rieperts.com/games/forum/screen_anchor.capx

  • legofreak689

    from the Browser object, you can "Invoke Download" to download a project file or a file from any URL

  • WallisonBR

    you are checking for collisions on ColisaoCesta, but setting the animation of another object (cesta2). So the basket is not "picked" and they all have their animation changed.

    try adding a sub-event under line 21 to pick nearest cesta2, and use ColisaoCesta.X and ColisaoCesta.Y as the coordinates

    (so add sub-event, choose the cesta2 object, find the Pick Nearest/Furthest, and add the x and y of ColisaoCesta)

  • jdejean

    I know the array can be pretty tricky to follow at first...

    There is no reason why you can't stretch the layout to hold as many questions as you want, or to add additional layouts.

    I updated my sample to show you how I would approach it. First I combined all the answer sprites into a single object to simplify the code. Each object has animations a through e, and instance variables that tell the game what question it is for, and what the answer should be if the player collides with it.

    (so, when you add answer objects to the layout, you set the animation, question number, and answer for each object. You also add a QuestionText object for each question and set its question number field as well.)

    Then, instead of having one global variable called CurrentQuestion, all the answer objects know what they belong to. Each instance of the QuestionText object also has a question number. As soon as the question array has been loaded from local storage (or reset), the game updates them with the text from the array.

    so, the player can run around the layout, read the questions and change their answers as often as they like...

    I made the Show/Hide values pop up a text box with all the questions and stats - otherwise you would need instances of the val1a(b,c...) text fields above each answer object... the text box isn't formatted very nicely, but lets you see all the stats from the array. The download button still works the same way as before.

    https://www.rieperts.com/games/forum/survey_platform.capx

  • jdejean

    dop's suggestion is the easiest... I added it to the sample I made last night for your other question...

    now there is an export data button. click that to download a file called SurveyResults.csv which can easily be loaded into excel.

    get my file here: https://www.rieperts.com/games/forum/survey_array.capx

    other options are: in NW.js you can directly write to a text file

    or sometimes, for one off cases I put the data in a textbox which can then be selected and copy and pasted into another program.

  • StickJump

    litetween should be able to do what you want... so try looking into the settings or make a small sample for us to look at...

    the other way to do it would be to use lerp. which would work fine, but is a manual way to do what litetween does for you.

  • with a POST command, you can add or delete records from the database... or update existing records.

    if you have multiple people placing orders and updating (or deleting) orders, you should use a database. A file could have one person overwriting someone else's order... and you don't want lost orders!

  • As George said, follow a few of the tutorials on AJAX and MySQL... That is how I got started a couple years ago. I have done lots of database work with construct2 and it works really well. There are several forum members that will be able to help you out when you get stuck, but it is easier for us if you have specific questions, and sample code for us to work with.

    If the restaurant already has a website, you can probably have that site host the database and app... rather than maintaining another service, but either way it should work fine.

    setting up the tables and fields you want in the database is pretty straight forward, but getting the access required by AJAX and PHP working initially is the hardest part.

  • jdejean

    you have a great start going there... so I thought I would add an array to your survey so you can see how it is done... it definitely gets a little confusing!

    my sample has 10 questions, but you can easily add as many as you want. I added a green "selection" indicator so kids will know what they chose, and they can change their answer without negatively affecting the stats (even if they go back to a previous question - as long as it is still the same session).

    I made the "Show values" button a toggle, so you can turn the percentages on or off. The totals are stored in the array, so it would be easy to make a summary screen at the end if needed... or available from a main menu.

    since it is stored in local storage, obviously everyone will have to use the same computer. If you needed multiple computers, then you would have to use AJAX and have a server to save the results on.

    good luck! and make those kids happy :)

    my version: https://www.rieperts.com/games/forum/survey_array.capx

  • pirx

    are the labels text objects that get updated every tick? that can be a big performance hit right there...

    also, watch out for doing unnecessary for each loops, and there are things you can do to keep collision checks down too...

AllanR's avatar

AllanR

Member since 21 Nov, 2013

Twitter
AllanR has 23 followers

Trophy Case

  • 10-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Popular Game One of your games has over 1,000 players
  • x2
    Coach One of your tutorials has over 1,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

19/44
How to earn trophies