droptank21's Forum Posts

  • Good question.

    Everything in HTML and Javascript is client side, that means, whoever is playing your game can theoretically view all the source to it. It will be obfuscated as part of the export process which will serve well in certain types of plagiarism, but for storing connections to databases, this is a big no no as anyone that can view the source and extract the database username and password could cause havock on it by executing any command they wanted. This is why there is no native support for database connections in HTML/JS.

    Why not just switch the .html to .php, it would still then run all the html and javascipt code but only process the php requests server side. I'm not a php/mysql expert but I'm fairly sure php code is not visible client side. The only dilemma I foresee would be not being able to include php into the js files.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • With HTML and AJAX requests, it will be really really easy to make requests to servers with HTTP requests to execute certain SQL commands, and retrieve data. Websockets will be more functional for streaming/realtime data.

    Tom

    Wait??? Let me be sure I'm reading your response correctly. HTML5 allows AJAX XMLHttpRequest objects within js files?

  • I suggest you to rewrite a preciser review of what your needs are and what you would like to see implemented.

    Okay. Basically a built-in IDE that allows php and mysql interoperability.

    For example: In the first layout is a splash screen where the user can login or register. The inputs are sent via php to a mysql database. If the user id and password exists in the mysql database the next layout is displayed. If the user is not logged in an error message is displayed.

    Register brings up a new layout where the user can create a user id and password and populated into the mysql database.

    Example 2: After loged in the user's character picks up a "usable item". The sprite for the item is destroyed on the main window but populates in the items inventory. Likewise, if the user utilizes the item from their inventory the sprite in the inventory is destroyed and that object's/sprite's event is run.

    Example 3: User's character takes damage from hazardous object. As far as I have seen in most of the examples so far, the health of the character is maintained in a js file which can be very easily hacked by anyone who knows js. If health/HP level is maintained as a variable in a mysql database and only accessed server side via php, it cannot be hacked by simply changing a js file.

    Example 4: User's character triggers battle sequence. New layout opens showing character sprite, moster sprite, HP, etc. (Similar to Final Fantasy 1 battle scenes) User clicks button to attack. Character sprite movement etc. Deals damage to enemy- damage dealt represented in message. Enemy responds dealing damage to character-damage dealt represented in message. HP level decreased. Character deals damage to enemy reducing enemy HP to zero. Enemy sprite dissolves. Victory message displayed. Stat change message displayed ($, Experience, etc...). Sequences back to prior layout before battle scenario layout triggered. New HP/MP/$/Exp variables updated.

    Those are just a few examples. What I am suggesting is an IDE implemetation to Construct 2 to quickly and easily add mysql variables and php script. Just as it is easy to add a sprite and set js script events for it, Constrcut should just as easily set mysql variables and set php scripts to manipulate and work with them. (IMO )

  • What file extension was the sprite?

  • I'm new here and to programming in general so go easy. Lol.

    I would suggest a built in library or what you all I suppose call a plugin of some sort that incorporates php and mysql.

    Allow the programmer to set variables in mysql, insert php code and such and auto populate the mysql info into an sql database.

    I may be covering something that Construct 2 already does, however I haven't yet seen any db files in any of the samples people have constructed.