Johann123's Recent Forum Activity

  • Bump! Are we allowed to bump here :(?

  • Hi guys! I’m thinking of creating a game with left right controls, but instead of using basic controls I’d like to control my character by tilting my head (left and right) tilting left makes my character jumps left, whilst tilting right makes my character jumps right. Is it possible to do that with C3 or to mimic such movements? Besides that, if that is possible, which external plugin would I need to create such behaviour?

  • Hi guys, I am met with 2 issues today.

    1) For my filechooser object, I can hide it with opacity, or throw it off the screen, then execute a .click javascript on my sprite to open a filechooser. However, how do I make it so, similar to the button itself, when you choose a file, it shows the filename. IE: image.png <-.. What I plan to do is to have a sprite to serve as the container, and add a label inside the container, and on image upload, I'll set the label's text to the image's name, <- Anyone have any idea what's the action for setting the text to the image name or if this is actually achievable?

    2) How can I detect the layout of landscape? I want it so my game can only be played in portrait mode, but as I can't force a user to fullscreen, or have control over what browser they might be using (Safari doesn't support fullscreen). What I plan to do is if you're playing in landscape, I'll pause the game and have a sprite asking you to rotate your screen, once rotated it'll unpause the game.

    Thanks!

  • When I incorporate css, i create a css file.

    For example, add something like this:

    #blablabla {

    border: 2px solid dodgerblue;

    padding: 5px;

    font-size: 50px;

    border-radius: 6px;

    }

    On start of layout :

    -> Browser: Load stylesheet from "myfile.css"

    and in the ID property of the textinput I type "blablabla"

    should work. You can apply the same "blablabla" in the ID of all of the textinputs of your project.

    Cool, thanks totally what I was looking for, guess I forgot to load the css on start of layout.

  • Currently I'm doing something like this and jesus I swear it is not meant to be used this way. This is going to take forever if it's meant to be done this way, can someone guide me through the right way? I have knowledge with CSS, I tried adding an internal CSS under "File" and using only ID instead of classes. Besides that, how would the CSS read my pseudo class? If it's meant to be done with the first way, when my textbox is :active, it bolds up like below, and I want to remove the bolded area.

    I tried ":active" , "none", didn't work.

    PS: Solved the bottom problem with Outline: "0"

  • I don't know. Maybe you can "reserve" the reward on the server, without deleting it. Save the time it was reserved. When checking for available rewards, pick records with reservedTime is null or (now-reservedTime)>15 minutes

    Thanks, based on the reserved logic I'll look more into it. I was wondering for the 4 keys input solution you provided, since it detects based on Keyboard input, is it fair to assume that it doesn't work on mobile? How would I go around making it work on both mobile and desktop? I understand that the box is a sprite, and it is just overlaying the sprite with text, and if the text == the pin in database, it shall allow access. But the keyboard doesn't popup when I'm using mobile.

  • ((Date.Now-start)/1000) is the number of seconds passed since the start of countdown. You can do whatever you need with this number. For example compare if it's >=20, this means that 20 seconds has passed.

    See this demo on how to format the time:

    https://howtoconstructdemos.com/simple-stopwatch/

    zeropad(floor(minutes - round((Date.Now-start)) / 60000 % 60),2) & ":" & zeropad(floor(seconds - round((Date.Now-start))/1000 % 60),2)

    Thanks Dop! So after awhile of testing, I've decided to use the logic above, it uses 2 variable though one minutes, and another one for seconds, but it gets the job done, except that I do know it's extremely flawed. But atleast it's real-time. I am attempting to write a logic to make it so when both the seconds and minutes var = 0, it will stop the game next.

    PS: Anyway I just thought of another issue that hopefully you may be able to answer me :c..

    So these are the scenario:

    1) My database has 10 rewards , lets call this Reward X. So these 10 rewards are loaded into my global variable through AJAX.

    2) A player plays my game, and win a reward X, so i will subtract 1 from reward X, and update my database. Now my database has 9 rewards left.

    3) My timer of 15minutes starts counting down, and within these 15minutes, if you do not provide me your address, the reward goes back into the pool (I'll be doing add 1, and update it through AJAX).

    4) When the 15minutes timer starts counting down and you close your browser (Forcing the game to close as well), I want the reward to go back into my database as well.

    ^ So based on the above scenario, is it possible to do #4? Or should I rewrite my logic to make it so, I do not deduct the rewards first, but instead to detect it on the 3rd step, where if the player actually inserts their address in step 3, then only I will deduct the reward.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • See this demo:

    https://www.dropbox.com/s/6zrsqmc62ps8nq7/RealClockCountdown.c3p?dl=0

    Even when the game is suspended, when you resume it, the timer will "catch up".

    Thanks for show me that, but I'm wondering, using the logic you had written, how is it possible to write action for it? Since by using the global variable subtract 1 action, the global variable constantly changes, and when it reaches == 0 , we can end the game. But currently, the timer counts down from 20, using milliseconds until it reaches 0. How would I go around making it if it reaches 0 the game ends? Also: Is it possible to format the countdown into a minute and seconds timer? IE: 10:00 -> 09:59.... etc, instead of using numbers such as: 600 -> 599.... Thanks!

  • 1. You need to use world clock instead of the "Every 1 second". Take a look at the Date plugin.

    2. I made a demo:

    https://www.dropbox.com/s/exiesrn5khmxbfr/CodeEnter.c3p?dl=0

    4. If the SMS Blaster doesn't provide this feature, then yes, you need to store the mobile number and the time it was last used on your own server.

    Hi dop! Thanks for having you here guiding me again, thanks for the .capx on the second question, it works splendidly. But on the first question, I had a look at the date plugin's documentation which is here: construct.net/en/make-games/manuals/construct-3/plugin-reference/date

    And had played around with it, but I'm not so sure on how am I able to use this to create a countdown timer. Or am I looking at the wrong plugin when you mentioned "World clock"? As even when I'm using the date plugin, I'm just converting miliseconds to minutes, but how do I get these minutes to subtract itself? At the end of the day I found out I'm still using the Every X second logic, which still makes my clock freeze.

  • Hi guys, I have a few questions which I would like to ask today and hopefully someone can point me in the right direction to learn.

    1) I've made a countdown timer by using zeropad, and a subtract 1 every 1 second logic, but this timer stops if the game is not active on the background, had anyone ever done allows the game to play in the background even when it is not active (minimized browser, etc), so even when the browser is minimized, the countdown timer still continues.

    2) So for the second question, now assuming that I am integrating a SMS blaster which generates a 4 digit pin, and this 4 digit pin only allows the player to play once every 24hour per mobile phone, is it possible to design it so the box currently looks like the image below? I currently just have a normal looking textbox which lets players enter their pin. Which looks like:

    3) Last question, now I know this is probably out of Construct 3's forums but had anyone ever worked with a SMS blaster provider? I understand how their API works and had tested it sending the message through their API. But how can I set it so each mobile phone can only receive a SMS code every 24hour? (I believe this is done through MySQL and timestamp) if anyone had done anything similar do guide me in the right direction!

    Thanks everyone!

  • Hey y'all, let me start off with the picture above to provide a better explanation. So currently, I have 3 different tiers, as you may see Tier 4-6, with them being 10prizes for tier 4, 5 prizes for tier 5, 5 prizes for tier 6. And each time a person gets one of these prizes, the numbers are deducted by 1.

    Credits to dop2000 for the tween code & logic provided

    But as these numbers are fixed, everytime a person plays the game on my server, the prizes resets, and I do not want that. How do I make it so the global variables remains changed permanently? So if someone gets prize 4, it goes from 10>9, and the next person that gets it, it goes from 9>8. Local storage is out of the question, as this game is intended for different players. I had asked a similar question previously, and I'll be trying the solution (Which is reading a txt file using Ajax) when I'm home from work to see if it works. But I'm open to other solutions, hopefully something which will allow me to directly read from my database table, and once it is done subtracting the prize, it'll post and overwrite the content in the database but I'm not sure if this is possible.

  • What's stopping one player to run the game 10 times, or open it in 10 browser tabs, and collect all prizes?

    I actually plan to do look for a SMS Verification provider which provides a 4 digit number similar to (TAC) or (OTP), this way I can limit the users based on their mobile phone. So unless they have 10 mobiles, they won't be able to win 10 times, even if they do have 10 mobiles, it is not guaranteed that they'll be able to win on every single device (the game is extremely rng), it's the spinning wheel you showed me. I'm currently digging deeper into this SMS verification provider to see if it's do-able with construct.

    Oh PS: Would like you give you a shoutout dop2000 since you're here. Your solutions across the forums are the absolute best.

Johann123's avatar

Johann123

Member since 18 Jun, 2020

None one is following Johann123 yet!

Trophy Case

  • 4-Year Club
  • Email Verified

Progress

5/44
How to earn trophies