How do I use php in Construct 2?

Get help using Construct 2

Post » Tue Sep 13, 2011 1:06 pm

[QUOTE=Mehtab] Can you show me step by step? That will be a great appreciation.[/QUOTE]

I've been working on my game the past couple of days since picking up Construct 2 and it uses the AJAX object. When it's done, I'll submit a tutorial on how I did it.

There may already be a tutorial in the works as I understand someone was working on one. Either way, I'm a couple of days away from getting my test game out and you can see it working I hope.
B
18
S
8
G
7
Posts: 120
Reputation: 5,630

Post » Tue Sep 13, 2011 1:20 pm

Setting up PHP and a database is a reasonably complex thing to do, needing some technical knowledge. I don't think Scirra is the place to go to learn about PHP and databases. There are already loads of free tutorials to find to learn about that - I think any tutorial on Scirra should assume you know about PHP and databases already, and just show the part where you access it via the AJAX object.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,610

Post » Tue Sep 13, 2011 8:50 pm

Yep. That's all the part I need. I already have the db and necessary php files set up (I think ). I just need some insight on using AJAX to Post and Get info to/from my application.
B
22
S
9
G
3
Posts: 203
Reputation: 3,647

Post » Tue Sep 13, 2011 11:03 pm

It's actually not a hard concept to get your head around - an AJAX request is a bit like opening the page in a browser, and the returned data (LastData) is the text that appears in the browser page. Still, a tutorial would be useful.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,610

Post » Tue Sep 13, 2011 11:20 pm

I have the basics for the AJAX object working on my test game. It will post and show a score in a simple listing. I'll write a quick tutorial for everyone so I can remember how I did it too.

Sample test game with AJAX object posting to database.Tom2011-09-13 23:46:55
B
18
S
8
G
7
Posts: 120
Reputation: 5,630

Post » Wed Sep 14, 2011 1:40 am

Ghengis I love your game "CASH ROLL". What a fun, and addictive game. Did you make all the game art yourself? I'm looking forward to your AJAX tutorial Iv been working on a database, and some php scripts for a social game like FarmVille, and I would really like to use Construct 2 to build it. Wink2011-09-14 01:47:17
B
50
S
11
G
8
Posts: 479
Reputation: 9,911

Post » Wed Sep 14, 2011 1:55 am

[QUOTE=Wink] Ghengis I love your game "CASH ROLL". What a fun, and addictive game. Did you make all the game art yourself? I'm looking forward to your AJAX tutorial Iv been working on a database, and some php scripts for a social game like FarmVille, and I would really like to use Construct 2 to build it. [/QUOTE]

Yes, I use to be a an illustrator before I got into programming.

The next step would be to create a login, member/avatar set up that will post to a leaderboard with achievements, points etc.

I'll write up the tutorial on the basics of the AJAX object. Then build on that.

Construct 2 is just an amazing piece of work by Scirra. It is very powerful. I'm so glad I found it.
B
18
S
8
G
7
Posts: 120
Reputation: 5,630

Post » Wed Sep 14, 2011 3:39 am

I added a tutorial with lots of screen captures and notations. I hope it helps someone. http://www.scirra.com/tutorials/61/how-to-a-simple-ajax-example-with-construct-2

B
18
S
8
G
7
Posts: 120
Reputation: 5,630

Post » Wed Sep 14, 2011 3:44 am

Ghengis, I don't have time to read the tutorial fully but at a quick glance it looks superb, good job!

Just so you know, you can split it onto multiple pages with:

==========

It's quite a long page so might be a good idea!
Image Image
Scirra Founder
B
125
S
37
G
25
Posts: 3,945
Reputation: 44,922

Post » Wed Sep 14, 2011 3:53 am

[QUOTE=Tom] Ghengis, I don't have time to read the tutorial fully but at a quick glance it looks superb, good job!

Just so you know, you can split it onto multiple pages with:

==========

It's quite a long page so might be a good idea![/QUOTE]

Thanks for the tip.

I didn't know I could split up the pages. When I was writing it, I did notice an unusual amount of scrolling on my part. I'll split it up. Things will be neater and it will load faster too.

*updated didn't to didGhengis2011-09-14 16:17:14
B
18
S
8
G
7
Posts: 120
Reputation: 5,630

PreviousNext

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 19 guests