I've been working on a browser-game for a few weeks now and things are coming along great... I've been able to get by with just php, but now I've come to a point that requires client-side interaction so I assume javascript is what I want.
I need some guidance as to go about creating this particular script. I've read up on javascript tutorials to get myself familiar with the basics, but I'm still weary of coding without any help because I'm still very noob with js.
http://www.foohonpie.net/troutslap/index.php
There is a test account available, user/pass is test/test. Login and on the sidebar, you will see a link called "Use Points".
The way it works is that players fight eachother for exp and money, and upon level up they are awarded a certian amount of "ability points". Right now the use points page (points.php) does the same as the main page, that is it just retrieves and displays the user's info/stats. What I want it to do is update the values depending on how the user chooses to spend his or her points.
You'll notice on the page that next to each stat is a + value. hp + 10%, str + 1 etc...
What I envision is a + and - button next to each of those, and when a user clicks any + buttons, it subracts his free points by 1, and updates the effected stat. When free points = 0, all the + buttons show as unclickable. at that point the user would submit the form which would be sent to be processed with the new values being sent to the user's row in the db.
now... i understand how onclick works but I'm lost as to how to go about assigning the player's stat values to variables that javascript would use, and how to actually update the shown values when the user plays around with how he might want to use his points.
i'm not the best at wording things, but hopefully you get the picture. i'm not asking for anybody to code this for me, i just need some guidance as to how to structure everything. and hey, if you choose to sign up for the game for yourself i'll gladly give you a custom forum tag for any help you can give me, if that's worth anything =P you'll be the envy of roughly a hundred 15 year olds