WHO SAID YOU CANT CREATE A DATABASE WITH CONSTRUCT2?

3

Index

Stats

13,230 visits, 31,129 views

Tools

Translations

This tutorial hasn't been translated.

License

This tutorial is licensed under CC BY 4.0. Please refer to the license text if you wish to reuse, share or remix the content contained within this tutorial.

Published on 21 Mar, 2012. Last updated 19 Feb, 2019

Yeah I am very happy to learn that Construct 2 can be used to create:

-an app

-a slideshow/presentation

-animation

-apart from the game creation itself.

After learning, an idea of making a Database Form App came up and to my surprise is working but Im trying to get a finish touches on it. The beauty of is no additional plugin was needed All what is needed is mainly

--global variables.

--Private variable

--array

--webstore

--form control (buttons, labels and textboxes)

Adding additional plug-in will make it a better, beautiful, effective and functional database.

From here we will go straight in showing how one goes and make a simple database but you can broaden your mind and create a login form for you game creation so making the user having an account for his/her own game. Or having checkpoints and level creation stored once the user accomplishes the level.

Here I expect you to have familiar with the Construct 2 and not a very newbie.

Let’s Begin:

Open your Construct2 and create a new single file project. I will call it Vocabulary Store.

Insert buttons, textboxes and labels like in the screenshots below

Insert Webstore Object.

Insert Array Object of a 3(number of textbox we have) by 1 by 1. Name it Database. Then go to the project property view and change the window size to 550 by 650.

Note you are free to name, add any object and arrange the way you want.

Now the “Coding”:

Open the events sheet and add the various events

Add some global variables as such:

A Word as text and set it to nothing

represent the data that will be stored from TextWord.Text

B Synonyms as text and set it to nothing

represent the data that will be stored from TextSynonyms.Text

C Meaning as text and set it to nothing

represent the data that will be stored from TextMeaning.Text

D Index as number and set it to 0

represent the number of times you will click the AddBtn OR

represent the Unique Key for your data storage

E tIndex as number and set it to 0

*Get the number from the TextIndex.Text then subtract the number and input it back to TextIndex.Text thus retrieving the data that corresponds the TextIndex.Text to the Unique Key number hence

functioning for the Back Operation Data when one press BackBtn*

For the Next Operation Data the number is added when one press NextBtn.

Note the first three variable depends on the number of textbox which correspond to the name of the Textbox you gave and which also determine the number of array (database). Width ie

If you have 5 Textbox you will an array.width of 5 and also 5 global

variables for it.

              I hope you are getting what I am saying.


  • 2 Comments

  • Order by
Want to leave a comment? Login or Register an account!
  • I was not able to download the CAPX..

  • I have an application that will allow a user to have their own database. Is it possible to create a blank database for every new user?

    Is it possible to create a blank MySQL database on my website, then simply copy it when a new user logs in?