theubie's Forum Posts

  • If you are using key down for the arrow keys or the spacebar it doesn't trap the keys before the browser gets them. To fix this, make events for key PRESS for the arrow keys and the space bar and just leave them blank with no actions.

    Any events C2 finds will be blocked from reaching the browser.

    See the manual entry for the keyboard object for more info.

  • Tinimations

    haifisch is almost correct...he's missing an "&"

    Player -> set animation "leftpunch_x" & VariableX & "_y" & VariableY

    You can concatenate strings and use variables to piece together the name of the animation you wish to set.

  • Every tick is an even that runs without a condition every tick. Events with conditions are evaluated every ticks as well, but they have a condition.

    So, if you want to update your UI every tick no matter what is going on, you use every tick. If you, instead, only wanted to update the UI every tick when the player was on screen, you'd use Player -> is onScreen.

  • You would need variables to hold the starting point of the jump. Then at the end of the jump you can compare the points from the saved starting point with the point that the player is at to figure out the distance.

    You'd start by making two global variables:

    StartX

    StartY

    In the event that starts the jump (let's say pressing the spacebar) you would do something like this:

    Keyboard: on key "spacebar" pressed

    • System: Set StartX to Player.X
    • System: Set StartY to Player.Y
    • (do your jump code here)

    Then, once the player lands you would use:

    distance(StartX,StartY,Player.X,Player.Y) to find the distance.

  • Since the touched object is the currently picked object, you can use "Object.UID" to get it's UID as an expression. Just plug it into whatever you need.

    System: Compare Two Values MyVariable = Object.UID

    For example.

  • Add a Inverted IsFlashing condition to the event so that it'll only fire if the variable is 1 and it hasn't already started flashing yet.

  • Is the array to be filled a fixed size?

  • Easiest way I can think of would be to use an array.

    Something like this:

    <img src="http://www.infinitepossibilitygames.com/demos/arraynumber/arraynumber.png" border="0" />

  • From the manual on system expressions:

    find(src, text)

    Find the first index within src that text occurs, else returns -1.

    So, you can use find(textbox.text, "sit") and if it comes up with anything other than -1, the word sit is in there somewhere. Unfortunately, it would also find any words containing "sit", such as situation. If you wanted to make sure it was a specific word you could go with:

    for "loop" 0 to tokencount(textbox.text, " ")

    -Compare to values: tokenat(textbox.text,loopindex("loop")," ") = "sit"

    That would break the string up by spaces (i.e. words, if the person isn't a bad typist like I am) and check each piece individually.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • A capx would be helpful on this one. Would need to see how you've got things laid out and your code behind it.

  • I'd suggest doing a Google search for using IFRAME tag. It's not majorly complicated so one or two sites should have you ready to use the tag to embed your game.

    As for Google analytics: Looking at the page source for your game I don't see the analytics tracking code. That's why it's not tracking traffic for that page. You'd have to insert it manually to the index.html file that is generated from C2's export.

  • Then you should have little trouble using Ajax and a back end setup. Pick your fav programming language (that your server can support) and have at it!

  • I use the built in urlencode from C2 to encode and the htmlspecialchars_decode function on the php side for our Ajax transfers for UWE and it works just fine.

    Also, just as a side tip make sure you're sanitizing anything you're putting in the database to prevent injection attacks. mysqli_real_escape_string or something similar.

  • To do something like that you're going to need to use Ajax and have some knowledge of a back end programming language like php.

    If you have that kind of knowledge I have written a tutorial for someone else on using ajax/php/mysql to send high score information to a server and retrieve it. You could adapt that process to a user login system. It's how we're handling user logins with our rewrite of our game UWE. Although that login system is way more complex than what you're talking about, it still breaks down to using ajax to send the user name and password and then checking it's return info to see if it was successful.

  • With about 10 hours left I realized I could finish the project if I took short cuts and dropped several items I was planning, however I refuse to do that...

    So I'm declaring that I have failed the official 7DRL challenge.

    However, I'm going to spend some more time on this and actually finish the game. The point is...it was fun to try, and I've come up with some good techniques for future games so it was worth the effort.