Webmaster Forum


Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Coding Forum Problems with your code? Let's hear about it.

Ezilon Directory   Perfect Money   V7N Directory

Reply
 
LinkBack Thread Tools Display Modes
Old 04-19-2006, 12:53 PM   #1 (permalink)
Contributing Member
 
I like pie's Avatar
 
Join Date: 10-12-03
Location: California
Posts: 254
iTrader: 0 / 0%
Latest Blog:
None

I like pie is a jewel in the roughI like pie is a jewel in the roughI like pie is a jewel in the roughI like pie is a jewel in the roughI like pie is a jewel in the roughI like pie is a jewel in the roughI like pie is a jewel in the roughI like pie is a jewel in the rough
Send a message via ICQ to I like pie Send a message via AIM to I like pie Send a message via MSN to I like pie Send a message via Yahoo to I like pie
javascript troubles

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
__________________
Foohon Pie Productions

Last edited by I like pie : 04-19-2006 at 01:06 PM.
I like pie is offline  
Add Post to del.icio.us
Reply With Quote
Sponsored Links
SEO Hosting by HostGator  Advertise Here  Buy Blog Links
Old 04-19-2006, 07:44 PM   #2 (permalink)
v7n Mentor
 
digiweb's Avatar
 
Join Date: 04-07-06
Location: Manchester, NH
Posts: 759
iTrader: 1 / 100%
digiweb is a glorious beacon of lightdigiweb is a glorious beacon of lightdigiweb is a glorious beacon of lightdigiweb is a glorious beacon of lightdigiweb is a glorious beacon of lightdigiweb is a glorious beacon of lightdigiweb is a glorious beacon of lightdigiweb is a glorious beacon of lightdigiweb is a glorious beacon of lightdigiweb is a glorious beacon of lightdigiweb is a glorious beacon of light
Send a message via Yahoo to digiweb Send a message via Skype™ to digiweb
OK - first is "I like pie" from mystery science theatre? We've been known to greet each other with "I like pie," as well as "Hooray for socks!"

Just curious

If I understand you, you want the customer to click a button and have it affect his point total

The points are stored on the server, right? So why would this be client script?
digiweb is offline  
Add Post to del.icio.us
Reply With Quote
Old 04-19-2006, 08:26 PM   #3 (permalink)
Contributing Member
 
I like pie's Avatar
 
Join Date: 10-12-03
Location: California
Posts: 254
iTrader: 0 / 0%
Latest Blog:
None

I like pie is a jewel in the roughI like pie is a jewel in the roughI like pie is a jewel in the roughI like pie is a jewel in the roughI like pie is a jewel in the roughI like pie is a jewel in the roughI like pie is a jewel in the roughI like pie is a jewel in the rough
Send a message via ICQ to I like pie Send a message via AIM to I like pie Send a message via MSN to I like pie Send a message via Yahoo to I like pie
there's actually an interesting story behind the name, it involves the "wizard" comic book price guides.

but anyway.. the points are indeed stored on the server, but what a player does with the points would happen on a client side script.

let's say i have 5 points

i can put 3 into increasing max hp, 1 into luck, and 1 into defense. before i press "submit" i would look at it, and decide if that's what i want or not. maybe i'd rather have just 1 into max hp, and put the other 2 into defense, or even put all 5 into power.

it just seems like a nice option for players to be able to play around with the numbers in a "preview" like state before deciding on what they want and submitting the form


but... i've since decided that this is way beyond my ability and I have too much to do already without learning, writing, debugging, and integrating javascript into php

i still want to do this, but i'm putting it off until i'm ready to redesign the game as a whole. i mean it's still alpha testing, who needs pretty pages and user-friendly interaces =P
__________________
Foohon Pie Productions
I like pie is offline  
Add Post to del.icio.us
Reply With Quote
Old 04-20-2006, 07:16 AM   #4 (permalink)
v7n Mentor
 
digiweb's Avatar
 
Join Date: 04-07-06
Location: Manchester, NH
Posts: 759
iTrader: 1 / 100%
digiweb is a glorious beacon of lightdigiweb is a glorious beacon of lightdigiweb is a glorious beacon of lightdigiweb is a glorious beacon of lightdigiweb is a glorious beacon of lightdigiweb is a glorious beacon of lightdigiweb is a glorious beacon of lightdigiweb is a glorious beacon of lightdigiweb is a glorious beacon of lightdigiweb is a glorious beacon of lightdigiweb is a glorious beacon of light
Send a message via Yahoo to digiweb Send a message via Skype™ to digiweb
ok you don't need client script for that. Just setup the dropdowns for the possibilities in html and submit the form once the values are decided.

It doesn't allow for a theoretical "what would my account look like if I bought 50 gobs horsepower," but you could have a preview on the server side that could do that.
digiweb is offline  
Add Post to del.icio.us
Reply With Quote
Old 04-20-2006, 06:47 PM   #5 (permalink)
Contributing Member
 
I like pie's Avatar
 
Join Date: 10-12-03
Location: California
Posts: 254
iTrader: 0 / 0%
Latest Blog:
None

I like pie is a jewel in the roughI like pie is a jewel in the roughI like pie is a jewel in the roughI like pie is a jewel in the roughI like pie is a jewel in the roughI like pie is a jewel in the roughI like pie is a jewel in the roughI like pie is a jewel in the rough
Send a message via ICQ to I like pie Send a message via AIM to I like pie Send a message via MSN to I like pie Send a message via Yahoo to I like pie
That's the thing though, if I set the dropdown to use a certain amount of points, it should effect what the other dropdowns show me for actions. html won't do this for me

and it's also a matter of visual appeal. it should be clean, preferably with single +/- buttons or links that control everything, not checkboxes or dropdowns or anything

but to be honest I think I prefer what I ended up doing. now when a player has any points to use, it shows an "add" link next to each stat on his main page, where clicking it will use 1 point for that stat. seems to work well enough, and doesn't look too bad either
__________________
Foohon Pie Productions
I like pie is offline  
Add Post to del.icio.us
Reply With Quote
Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum

Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Firefox troubles GoogleIsAPain Coding Forum 5 01-05-2006 03:55 PM
Firefox Troubles Again SN3 Computers & Internet 21 09-13-2005 02:03 PM
My Constant SEO Troubles ParLawGod SEO Forum 10 08-29-2005 10:42 AM
I'm having troubles setting up Adword, please help. lszutoo Google Forum 1 12-11-2003 05:49 PM


Sponsor Links
Get exposure! Get exposure! Find Scripts Web Hosting Directory Get exposure! SEO Blog


All times are GMT -7. The time now is 11:17 PM.
© Copyright 2008 V7 Inc