theubie's Recent Forum Activity

  • You're going to have to use Ajax to store things in the database...not really a way around it other than opening a websock connection.

    Basically, C2 is being used as a very pretty (and powerful) GUI for our game. It's a LOT easier than our original iterations of the game. Our original game had a pure php/html front end. You moved from page to page and that worked ok. Our next iteration moved to a pure HTML/Javascript/Ajax routine and that allowed us to make our interface look good, but we were still bound primarily by HTML for how things look.

    Using C2 I actually can use artists to directly create sprites and background and not have to chop them up in Photoshop and lay them out using HTML elements. In the previous versions I had some great concept art work that just wouldn't translate to HTML that I had to pass on.

    We're still a long way out from an open alpha/beta test, but the combination of having written the back end for this game 3 times with the flexibility and features that C2 offer has already made just our bare bones prototyping of the game as much if not more enjoyable than our other two versions combined.

  • It's a cross domain issue. There is a way around it, but you open yourself up to potential misuse by doing so.

    You can setup the headers at the beginning of your php file to allow any domain (or specific domains) to access the php script.

    Personally, I setup my ajax call to send a variable called "key" and the script will look for the key variable and if it sees it, it added the header. If it doesn't, it just does things normally so calls from the same domain still work.

    Do a Google search for cross domain ajax php header to find out more info on how to set it up. If you still have issues with it, I might be persuaded to write a tutorial like I did for the Highschore table without a plugin via php/ajax that's on my site if I have time this week.

  • Not to throw more gasoline on the fire, but like the others have said you can make longer games with C2.

    And we are also working on a rewrite of our web based MMO using C2 as the front end. All of the actual work is done on the back end via php/MySQL. We're using Ajax to bring data to the user and to allow C2 to be the interface to make things happen.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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.

theubie's avatar

theubie

Member since 13 Jan, 2013

None one is following theubie yet!

Connect with theubie

Trophy Case

  • 12-Year Club
  • x2
    Coach One of your tutorials has over 1,000 readers
  • Email Verified

Progress

14/44
How to earn trophies