Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

Complicated! Help?


  • Please log in to reply

#1
Dedrivudd

Dedrivudd

    Member

  • Member
  • PipPip
  • 98 posts
Okay so here is a question.

Can i make a a special "poll" or something like that. It should work like this:

a line that "burns" out when none clikc it.. Example lets take virtual pets.. they have "feed meter" when people clikc feed the metter fills a bit, but if none uses it it burns out.. so what's the code to the link feeed react to the meter?

Is this possible? and what scripting code should i do?

I hope you understanded
  • 0

Advertisements


#2
gust0208

gust0208

    Member

  • Member
  • PipPipPip
  • 311 posts
Hello,

It would greatly help if you could give us a bit more information about what you are trying to do and how people will use this poll. Is this going to be on a website, a stand-alone application? These are the details that will better help us to recommend a programming language.

Cheers,
tom

Okay so here is a question.

Can i make a a special "poll" or something like that. It should work like this:

a line that "burns" out when none clikc it.. Example lets take virtual pets.. they have "feed meter" when people clikc feed the metter fills a bit, but if none uses it it burns out.. so what's the code to the link feeed react to the meter?

Is this possible? and what scripting code should i do?

I hope you understanded

View Post


  • 0

#3
Dedrivudd

Dedrivudd

    Member

  • Topic Starter
  • Member
  • PipPip
  • 98 posts
Okay os her e goes.

I want to make a site for "pets". Similiar to neopets, but much more easy. It would go to people like my little sister. A pet (drawing) that can be played with and feeded.

The feeding would go like this:

they click the pet then there comes a selection

Feed
Play With
Put to sleep


etc.

and there would be meters that measure how hungry the pet is or how sleepy it is.. etc.

The fill the meter by clicking example: feed. Then the meter goes a bit up. the a message comes you have fed the pet. the meter has a maximum fed ammount. When it has reahced it can't me fed. but if none feeds it for a while it "burns" out..

Okay so i know how to make things like "this site has been visited # of times" and i'm going to use "This pet has been fed # of times" I need to know how to make the meter thing..

SO it would be a site where you can feed them.

I would use Java Script
  • 0

#4
gust0208

gust0208

    Member

  • Member
  • PipPipPip
  • 311 posts
Hello,

That sounds like a good outline of the project you want to accomplish. One thing to note is if you want your javascript to be able to tell how "long" since a user last fed it, you are going to be needing to use cookies. Cookies are basically a very small file that your javascript creates and saves on the users computer through their browser. Using this, your script will be able to tell the last time the user visited and how "full" their pet was when they left.

Would you be able to create a rough web page so we know what variables we have to work with in your project? From your description, I envision just a picture of some fantastical creature with 3 buttons, "Feed", "Play With", and "Put to Sleep". Functionality of those buttons:
"Feed":
Increment a counter up to a 100 (easy way for me to think of being a 100% full), once counter has hit 100, grey out button to prevent further feeding.

"Play With":
Also use to increment a counter that reflects a pet's "mood" (higher the better?).

"Put to Sleep":
I would maybe change the name to one that doesn't have connotations of euthenasia. But this I would have this button operate as a user's "Exit" button when they are done interacting with the pet. Clicking this would exit out from the script and write the necessary variables to a small cookie for the next time they visit.

The script for this would be pretty straight forward. If interested, I can try to put together some sample javascript code for this, but mainly we want to help you with your project.

Cheers,
Tom

Okay os her e goes.

I want to make a site for "pets". Similiar to neopets, but much more easy. It would go to people like my little sister. A pet (drawing) that can be played with and feeded.

The feeding would go like this:

they click the pet then there comes a selection

Feed
Play With
Put to sleep
etc.

and there would be meters that measure how hungry the pet is or how sleepy it is.. etc.

The fill the meter by clicking example: feed. Then the meter goes a bit up. the a message comes you have fed the pet. the meter has a maximum fed ammount. When it has reahced it can't me fed. but if none feeds it for a while it "burns" out..

Okay so i know how to make things like "this site has been visited # of times" and i'm going to use "This pet has been fed # of times" I need to know how to make the meter thing..

SO it would be a site where you can feed them.

I would use Java Script

View Post


  • 0

#5
Dedrivudd

Dedrivudd

    Member

  • Topic Starter
  • Member
  • PipPip
  • 98 posts
Okay..

That helped me a alot.. hmm.. just one thing more everyone can click it.. even the people who don't own it..

And I think I will find over google or my books how to set cookies, buit if you can tell a bit it would help! The examples would help. I won't do straight copying i'll take it as a example!

Edited by Dedrivudd, 08 October 2005 - 11:10 PM.

  • 0

#6
gust0208

gust0208

    Member

  • Member
  • PipPipPip
  • 311 posts
Hello,

It is going to be quite more difficult to allow any person to feed a pet, as opposed to the owner being the only user to be able to feed it. In order to allow any person to interact with a pet, you are going to need some sort of server-side way of storing information, cookies won't cut it. I have not done a lot of Javascript lately, but I don't think it has the ability to write to files server side as a safety issue. If you want to implement that only the owner can feed a pet, I can make up some code, otherwise we will have to look at a different programming language like Perl to allow for some more server-side options.

Cheers,
Tom

Okay..

That helped me a alot.. hmm.. just one thing more everyone can click it.. even the people who don't own it..

And I think I will find over google or my books how to set cookies, buit if you can tell a bit it would help! The examples would help. I won't do straight copying i'll take it as a example!

View Post


  • 0

#7
Dedrivudd

Dedrivudd

    Member

  • Topic Starter
  • Member
  • PipPip
  • 98 posts
Hmm.. maybe I could start by that only owner eses the pet.. can you give some advices..
  • 0

#8
gust0208

gust0208

    Member

  • Member
  • PipPipPip
  • 311 posts
Hello,

Here are a few useful links with some demo code on using cookies with javascript. I will try and put together some code, but I am on call at the hospital and won't have as much time to put something together and could be a few days. Onto the links!

http://javascript.in...avorite-bg.html
- This is a great demo (with code) of setting proper cookies with information from the user. A quick description of how cookies are "put together". They consist of a bunch of name/value pairs. You can then extract information from the cookie by using the name and it will give you back the value. An example of a name/value pair from your project would be "hunger_meter/100". In the code example, you will see the key functions are SetCookie(name,value) and GetCookie(name). So, SetCookie is how you store one of your name/value pairs and GetCookie is how you get the value for a particular name.

Let us know if you have any questions and and we are glad to help you understand the code. Are you starting from scratch with learning programming or have you had some javascript of other programming experience? It can be a bit daunting at first...

Cheers,
Tom

Hmm.. maybe I could start by that only owner eses the pet.. can you give some advices..

View Post


  • 0

#9
Dedrivudd

Dedrivudd

    Member

  • Topic Starter
  • Member
  • PipPip
  • 98 posts
I'm starting form scratch but no worries I can do it :tazz: I know it's hard etc. but I'm up to it.. Thank you very much for your help. I will look into these cookies and Javascript. You have been a great help. I wll post here If I get problems. Thank you very much!
  • 0

#10
gust0208

gust0208

    Member

  • Member
  • PipPipPip
  • 311 posts
Hello again,

As you start your programming, a good text editor is key. One crucial feature (in my opinion) is syntax highlighting. Syntax highlighting is simply the editor color-codes certain key words and enforces proper indentation in your code. It makes your code infinitely more easy to read and to work with as you go. I highly recommend a great free text editor called "Crimson Editor" that not only has syntax highlighting for pretty much any programming language you will use, it also features a tabbed interface like Firefox so you can have multiple files open in one window and easily move between them. Check it out and download it at:

http://www.crimsoneditor.com/

Cheers,
Tom
  • 0

#11
Dedrivudd

Dedrivudd

    Member

  • Topic Starter
  • Member
  • PipPip
  • 98 posts
Yup I have crimsom.. I have planned this for a long time :tazz:

I prefer notepad all the way!
  • 0

#12
gust0208

gust0208

    Member

  • Member
  • PipPipPip
  • 311 posts
Hello,

I have attached a demo javascript and HTML page that implements a "Feed" button that when clicked increments until 100 and then will "grey out" the button and not allow one to click it again. The javascript also has all the code needed to work with cookies and should provide a basis for you to implement the other functionality you talked about.

Cheers,
Tom

Attached Files


  • 0

#13
Dedrivudd

Dedrivudd

    Member

  • Topic Starter
  • Member
  • PipPip
  • 98 posts
Thank you extremly much! You are a great help i will check it out!
  • 0

#14
gust0208

gust0208

    Member

  • Member
  • PipPipPip
  • 311 posts
No worries! :tazz:

Please post back to this thread if you have any questions as you go and we should be able to figure the code out as you go.

Cheers,
Tom

Thank you extremly much! You are a great help i will check it out!

View Post


  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP