Giving image values for game

Hello everyone and thanks for reading my request for help :slight_smile:

I am working on a basic game where 3 - 5 images will be displayed on each page for the user to see (there should be about 5 pages), each of these images will have a value e.g. -1, +1, 0, -10, +12. When the user clicks on an image his/her score will change and the next page with 3 - 5 new images will be shown. When all of the pages have been shown and the user has a score of lets just say 20 or more then more pages will be displayed, if not then a new page will display stating that the game is over.

My question is how do I give each image a value and how do I show a new set of images based on the overall β€œscore” of the player after the first set of pages have been shown?
And is there a way to display the players score on the page?

Thanks and any answers will be appreciated. :slight_smile:

If you know of any videos which may help me please tell me :slight_smile:

Well, most programmers would use some sort of database to keep track of this type of data.
You do not store the pictures in the database, but, their names and values.
Then, you would select them out and display them. When the user clicks on them, you could
use a lot of different ways to track the values. You can use Javascript or JQuery to monitor clicks as
needed and update a running value that is always displayed.

Give us a little more info on the 3 to 5 images. If there is only one click per group, meaning, if the user
clicks on of the 5 and then goes on to the next group, then you could do it with simple forms. Clicking
would post the form and then the PHP code would add up the total and echo it back with the new 5 images.

But, if the user must click on multiple images, you would have to use JS/JQ as it would be needed to do it
in the browser not server-side in PHP.

Not sure if that helps, perhaps more info on how you want it to work would give us ideas how to help you.

Sponsor our Newsletter | Privacy Policy | Terms of Service