PDA

View Full Version : using multiple choice quiz to keep track of game score



jundo12
05-02-2017, 06:44 PM
Would it be possible to keep track of a game score during a turn based battle (like subtracting health pts if one option is chosen or adding pts if another is chosen) using something like a multiple choice quiz, where the option value either adds or subtracts some value? the score itself is determined by the option selected and is then represented by how many health pts or mana pts are deducted/added for 2 players, one of which is a npc monster and the other of which is a player character. each round (player attacks, monster attacks or player heals) can have a whole new quiz so values don't have to be continually passed from page to page, only the score, which is represented by two graphics (player health/mana and monster health).

the upside is i can pass the score from one page to the next by modifying the graphics beforehand and just have the multiple choice display the relevant graphic that contains the health/mana (scores) of the 2 combatants, the downside is i have no idea how to do that with javascript. i'm assuming the script would have to display a graphical score instead of a number score.

perhaps it could take a full health/mana bar graphic and a smaller graphic representing an empty/full unit of health and an empty/full unit of mana, and automate the entire process by applying the empty/full unit to the correct location on the full bar graphic, using z-indexing

if damage done is never more than 1 unit per round it is easily assigned the multiple choice option value of -1 health unit.
if heal is chosen and is never more than 2 mana per round, it is easily assigned the value of -2 mana units and +2 health units.
the monster always deducts 1 unit from the player each round. but the player may not always deduct 1 unit from the monster, if they choose to heal instead.
not sure how that could be depicted using multiple choice quiz options.

Deadweight
05-04-2017, 12:18 AM
Assuming you aren't using a database...

If you are allowed able to use php then I would do something like this ->
main page that uses ajax (long polling to receive the information and one to send the information)
Php that can handle the sending and receiving
One folder that will queue the receiving information.
Another folder that stores the current information (when that folder has something in its queue it should update the this folder and then send back the information eg long polling in a sense)

Not sure how much information you know and how you want to store that information but there is part of what I got.

jundo12
05-04-2017, 12:29 AM
well frankly, i'm just an old html person. like i use to code websites by hand, typing out all the html statements including the header, footer, body statements. then css came along and i learned that, mostly, but javascript i'm sooooooo unfamilar with that i barely recognize what the statements mean. whereas php........i heard of it once. hehe. i know it's nigh on impossible to work with it on desktop without a desktop server script of some kind and that's where my info begins and ends. oh and i know it gets hacked alot if used to make a forum . lol

jundo12
05-04-2017, 12:37 AM
i was thinking if a multiple choice quiz can keep track of a score for a quiz, it could keep track of a score in a game. in both cases, the variables are determined by the participant and the person who made the quiz. the only modification would require the script to display the score at the end of each round as a graphic *with tinier graphics being added or taken away, depending on the score (whether you as the player picked option 1 (fight) or option 2 (heal). i tried to calculate how i could depict every possible option for 30+ rounds of battle and with 2 options and it's in the hundreds of individual possibilities. nuts crazy stuff

Deadweight
05-04-2017, 12:37 AM
Is this just a personal game for you or are you wanting other people to use this also?
PHP will be harder to hack if you know what you are doing. I use xampp (https://www.apachefriends.org/download.html) for without a live server to code in php.

jundo12
05-04-2017, 12:47 AM
well its a game for people to play. i'm trying to make it so other people who aren't coders can just copy the scripts, add their own graphics and sound files, and make their own games (it's for people like me who aren't programmers/coders -- many artists and musicians who are so right brained, there's no way they could code but are imaginative and want to express it in game format but really can't cause they couldn't add up their grocery bill much less do algorithms for game codes). the problem is, it's currently a huge mess of all kinds of coding no-nos, like inline css, javascript and html together in same statement, styles scripts not in their own files, and so on. real coders would laugh their butts off at it, after getting over the haphazard mess it is.

i just got a server to put it on and am preparing myself mentally for learning how to use filezilla. i'm accustomed to wsftp

jundo12
05-04-2017, 12:58 AM
its extremely graphic intensive. large images, full screen, many sound files, but works like a webpage (no loading screens), so i thought i would just put the front end of it on the net. it would start with the support page, then dive into the introduction, then the character creation page. once the charaacter is chosen they download the game with that character only to their desktop. otherwise, it would rival wow or guild wars, in sheer size and just be a silly website made into a game.

jundo12
05-04-2017, 01:22 AM
oopsie.

Deadweight
05-04-2017, 01:23 AM
Sadly to write to a file you'll need ajax with php.
Here is a tiny example:
http://stackoverflow.com/questions/26961750/write-server-text-files-with-ajax

jundo12
05-04-2017, 01:27 AM
oh i don't want it to create the pages. i can do that. i just want a script that'll keep track of the score for one round. then display the score as two graphics (1 graphic for player, 1 graphic for monster) each depicting health/mana bars. then i can copy the script and repeat it for each round

jundo12
05-04-2017, 01:35 AM
wrong url

jundo12
05-04-2017, 02:00 AM
can you calculate how many individual pages i will have to generate with the following variables as the guidelines

1. player 15 pts health 30 pts mana
2. monster 30 pts health no mana
3. player does 1 pt damage each round/ if they don't heal instead
if they heal instead, player loses 2 mana but gains 2 health pts.
4. monster does 1 pt damage each round
5. player only has two options: hit or heal and its always for same amount = 1pt. damage or 2pts heal which is also -2 pts mana.
6. monster always hits for 1pt

how many variations of the battle would i have to depict to show all possible combinations of heal/no heal and hit/no hit (Cause it's turn based, if they heal, they don't hit for that turn

jundo12
05-04-2017, 02:52 AM
with the attack /heal animations on their respective pages, already made, the only thing that needs to happen when the player pushes either button for hit or heal, is for the graphic for health and mana for the player and monster to update its score, and the already created page for the option be loaded into the window. all the work is already done. the only thing changing besides hit page or heal page, is the score.

jundo12
05-04-2017, 03:09 AM
p.s. using php would mess up the download to desktop option.

jundo12
05-04-2017, 04:16 AM
here's the opening page. sorry about the other url
http://theangelsquest.com/