/    Sign up×
Community /Pin to ProfileBookmark

Help Needed: game points calculator

Hi, I’m a teacher developing an online scenario/game for my biology students. I am a bit familiar with HTML as I make my own webpages using HTML.

Question: can anyone tell me some code that will keep score in the game? Just simply add up points as the kids complete activities.

Thanks.

to post a comment
JavaScript

9 Comments(s)

Copy linkTweet thisAlerts:
@JMRKERFeb 18.2012 — Provide a sample game using your HTML skills

and we'll see where to advise you about adding a scoring section script.
Copy linkTweet thisAlerts:
@AnnWauthorFeb 18.2012 — Well, I'm not a game developer. I just build website lessons for my students. So, I give them a scenario that has choices embedded in it. When they make a choice they either have an activity to do to learn more or they move on to the next part of the scenario because they knew the right answer. The code is a series of divs like this:

<div id="apDiv10"><h5>An Ice Penguin Mystery</h5>

<p>A small group of Emperor penguins is stranded as a piece of the sea ice breaks off from the continent and is driven along the coast during a raging Antarctic winter storm. When the storm lets up, they find themselves many miles from their original colony. The ice they have been riding on is lodged in a small cove of sea ice far from their friends. The penguins must find a new nesting site immediately so the females can lay their eggs and return to the sea for food. </p>

<p>Choosing the right site can be a matter of life or death for the new colony.</p>

<h5>What do the penguins choose to do?</h5>

<div id="apDiv24"><a href="javascript:;" target="_self" onclick="MM_showHideLayers('apDiv10','','hide');MM_showHideLayers('apDiv24','','hide');MM_showHideLayers('apDiv11','','show');MM_showHideLayers('apDiv12','','show');MM_showHideLayers('apDiv25','','show');MM_showHideLayers('apDiv15','','show');MM_showHideLayers('apDiv16','','show');MM_showHideLayers('apDiv13','','show');MM_showHideLayers('apDiv14','','show');MM_showHideLayers('apDiv26','','show');MM_showHideLayers('apDiv27','','show');MM_showHideLayers('apDiv28','','show')">Show Me The Choices</a></div>
Copy linkTweet thisAlerts:
@AnnWauthorFeb 18.2012 — You can see the prototype for what I'm working on here (it's just in the beginning stages online:

http://www-rohan.sdsu.edu/~wellhous/project/activities/ecology_lessons/seaweed_scenarios2.htm
Copy linkTweet thisAlerts:
@JMRKERFeb 18.2012 — Quite impressive and quite complicated.

Where do you assign points for the actions performed?

Example:

Score = 0;

Student moves correct image to background, Score += 10; // points awarded

if not correct, no points awarded.

Next action, if correct, add more points to global variable Score until finished

then display final score or percentage based upon max points possible.
Copy linkTweet thisAlerts:
@AnnWauthorFeb 18.2012 — Yes. That's the idea exactly. What you see on the website right now is the simplified prototype so there are a few other choices. Those choices will take them to other pages to do activities so the points accumulated have to follow them around.
Copy linkTweet thisAlerts:
@AnnWauthorFeb 18.2012 — Also, they get points for just learning things rather than just the right answer to a question: kind of skill points to encourage them to do more on the site than just get the right answer.
Copy linkTweet thisAlerts:
@007JulienFeb 18.2012 — We want to note the professors: Still of the brainwashing on the global warming !
Copy linkTweet thisAlerts:
@JMRKERFeb 18.2012 — Also, they get points for just learning things rather than just the right answer to a question: kind of skill points to encourage them to do more on the site than just get the right answer.[/QUOTE]

You will need to define what events or actions are credited with how many points.

Events could be onclick, onchange, onkeyup, onkeypressed, etc.

See: http://www.quirksmode.org/js/introevents.html

or: http://javascript.about.com/od/hintsandtips/a/events.htm

or: http://www.comptechdoc.org/independent/web/cgi/javamanual/javaevents.html

or other sites with a 'google' search or follow a JS tutorial. ?
Copy linkTweet thisAlerts:
@AnnWauthorFeb 18.2012 — Thanks for the leads. I appreciate it.
×

Success!

Help @AnnW spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...