Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

7 years ago by harryfeng

Hi

I am new to impactJs. Hope I can get some help from here.

I need to create a game with 3 intro screen. And the game will be in facebook.

first screen have "play" button, after you click, you go to second screen(where you can see rules and control instruction).

in the second screen, there is also a play button. but after you click, the game will ask the user for permission to access their facebook data.

after they agree, another intro screen (the third one, will have a check box saying agree) and those data will be sent to a database(mysql) with user facebook info.

not sure what is the best way to achieve this.

7 years ago by StuartTresadern

Simple Option is to Setup some game states:

MyGame.MODE = {
            INTRO1:0,
            INTRO2:1,
            INTRO3:2,
            GAME:3,
            PAUSE:4,
            GAMEOVER:5,
        };

Setup a property in main.js named mode and then you can Change / detect the mode in your update and draw calls.

 this.mode = MyGame.MODE.INTRO1;

if (this.mode == MyGame.MODE.INTRO1){

// Do something
}

7 years ago by Husten

i made a facebookgame. the best ist the most easy way :) dont integrate the facebookstuff into the impactgame. simple

index.php : the frist screen with the button, forward to rights.php
rights.php: the second screen with the second button and when the user agree with the rights, forward to game.php
game.php: here you save the data from the user and start the impact.js game

you dont need to integrate the buttons etc into the game, the impact.js game can be at the and in an extra script :)

7 years ago by StuartTresadern

@Hunsten, I am Interested in why you say do not integrate facebook stuff ?. Sure the api's a bit of a pain but what sort of issued did you come across.

7 years ago by Husten

its easier to handle the facebookstuff without integrate it direct into impact.js. its just easier. when you have 2 screens before the game, you dont need to integrate it into the canvasgame. for example i made a competition for mcdonalds with impact.

file 1: the story blablabla an a playbutton, the playbutton asks on a popup the rights via facebookapi. if ok forward to 2

file 2: the file with the impact js game. you have to reach level 3. if you win forwards to file3

file 3: a form where the user can type his name and emailadress etcetc.

ok its easy to cheat, but its just a game. the winner will take randomly from all user which reached level 3.

its only an easier way i think. you can devide the facebookstuff from the inpacts stuff. both are tricky, so why complicate it? :)

7 years ago by harryfeng

thanks for replying my post.

For intro screen, I will use separate page.

also, I need to pass game score to database. Only way I know is using ajax/json. Is there any helper class in impact for me to do this?

or is there a better way to do this?

7 years ago by Husten

if you use jquery its just one line to post data via POST to another phpscript

http://api.jquery.com/jQuery.post/
Page 1 of 1
« first « previous next › last »