resdesign's Forum Posts

  • I am confused. Can I use spritefont to be input text? I guess I would need to givei it html code to act as input text but I am not really sure how to do that.

    I did not realize that the rendering was Canvas so I guess this makes sense though it surprises me since html does have input text.

  • My setup:

    layer position and description:

      HUD - this layer contains feedback screens (it is a global layer built in a different layout) GAME - this layer contains the input text boxes with submit buttons BG - this layer contains the background

    When the student presses the submit button, a feedback screen appears .

    Unfortunately though the feedback screen should be on the top to the textboxes since the HUD layer is above the GAME layer, they still appear above the feedback screen.

    Does anyone know how to correc this?

  • I gave up the continuous event using on touching because it is just too fast to be able to stop at the correct time that needs to match the question. Instead I increment or decrement by 5 and rotate 30 degrees for minutes and 2.5 degrees for hours. Both are going at the same time like a regular clock.

    This is different than setting up a clock for which there is a tutorial on this forum which I just discovered.

    https://www.scirra.com/tutorials/1450/v ... -24h-clock

    Since the student is the one who moves the hands the setup has to be different. I have a down button to go counterclockwise and a up button to go clockwise.

    This was more complicated than just setting up a digital clock that goes only clockwise on its own.

    I found the anwser for this if it helps someone. I decided to use only minutes in the background to make checking variables easier. Then I convert the time for the digital clock that is needing to be the same as the analog clock.

    Global variables
    hourText
    minuteText
    // conversion
    set hourtext to int(timer/60)
    set minuteText to int(timer % 60)[/code:5ox8tjk7]
    
    1- I check to see if the time chosen is AM or PM.
    2- The starting point has to be checked depending on AM or PM (see below) 
    3- for the display I use this on every tick:
    [code:5ox8tjk7]if hourtxt <12 then set text to right("00" & hourText,2) & ":" & right("00" & minuteTxt,2) & " " & timeChoice
    if hourtxt >11 then set text to right("00" & hourText-12,2) & ":" & right("00" & minuteTxt,2) & " " & timeChoice[/code:5ox8tjk7]
    So now it is all working. 
    
    Resetting the timer variable in order to have the correct start time depending on AM or PM
    [code:5ox8tjk7]// global variables: 
    timeChoice = ""
    timer = 0
    
    //UP/Clockwise button:
    if timer = 0 and timeChoice = "AM"  set timer to 0
    if timer = 0 and timeChoice = "PM" set timer to 720
    
    //DOWN/Counterclockwise buttton:
    if timer = 0 and timeChoice = "AM"  set timer to 720
    if timer = 0 and timeChoice = "PM" set timer to 1440
    if timer = 720 and timeChoice = "PM" set timer to 1440[/code:5ox8tjk7]
  • You also could use:

    "Time: " & right("00" & timer,2) & "m" & right("00" & timer,2)& "s"[/code:19mo87c1]
  • Very good information for the formatting of time. You just do not know this automatically. I used it in an educational game where students have to set an analog clock and it syncs and displays in a digital clock and it works perfectly.

  • It's actually hard to manage on a continuous move of the hands which works with touch in touch because of the lack of precision in the moves.

    The way I had it before on touch on touch was this:

    I added the variables minute and hour because I compare these in order to find out it they got the time correct. I have the correct answers for minutes, hours, and AM or PM in arrays. Of course it does not work when going clockwise because I get negative number and I probably need to reset the minutes to 60 to subtract from 60 instead of 0 in that direction.

    Hum...

    Thinking about it...

    I am thinking that maybe I need to just calculate the minutes compare to a whole day (60*24) instead. That way for example 7:30 PM would be in military time 19:30 or 19*60 + 30. Does this make sense?

    The code here is:

  • Found the solution - using touch in touch and setting to 1 degree so it is not too fast.

  • I have a clock that the students must put at a certain time by clicking up or down arrow images or using the keyboard. The minutes hand is set to rotate in 30 degrees increment that is 5 minutes increments (no times like 12:03 in the questions) and the hours are set in 2.5 degrees increment (as a normal clock).

    I would like the possibility to just press the up or down arrow that represent clockwise and counterclockwise to move the hands without having to click for each rotation and when release to stop where they are.

    How can I accomplish that. I was thinking about something like i++ in javascript but not sure how that works in C2.

  • Thank you for your input. This is a complicated subject. I personally use keyboard shortcut for lots of things but in this instance it seems like the best approach is to use the OS disability keys which I discovered after researching the subject. That way the students can also do drag n' drop with the keyboard acting like a mouse.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Never mind. I just needed to stop all sound before restarting the layout.

  • Here is my general set up for educational games. Since there are several games on a page, I have an intro screen with a start button.

    The start button moves out the intro screen and start playing the game music.

    In the game I have a Music button that toggles the music on or off with a click event or a Keyboard (M) event.

    When we use the reset button, though I stop the sounds, it is not killed. so when I start the game again I have the first music playing again and the new music starting to play, overlapping each others.

    Is there a way to actually kill the music on the reset button or should I start the music and set toogle to silent right away so it will always be the same music instance playing?

    Note: I cannot start the music on load otherwise when more than one game is on the page, they would all start playing their own music.

  • Thanks Lamar. I think we may have gotten around with asking kids with disabilities that prevent them from using the mouse to use the accessibility settings on their OS. Do you think that this is adequate? This way they can use their keyboard as a mouse and are able to play drag n drop games as well.

  • So far I have tried using spacebar for selecting the objects according to a variable I call 'selected'.

    Then I am using the arrow keys to navigate to the corresponding droppable which also works.

    I am just not sure this is the 'standard' way to do things if there is a web standard.

  • I have a number of drag n drop educational games that need to have keyboard options instead of drag n drop.

    Is there web standard for that and what keys should I use?

    I am thinking that the student will need to:

    1 - select the object to drag

    2- use arrow key to move the object to the proper area

    3- use a key to select next object to drag

  • OK. I feel very embarrassed. It actually works. The reason I thought it did not work is because I forgot to set the speed of the animation button to 0.