dcsimg
www.webdeveloper.com
Results 1 to 10 of 10

Thread: what would be easyer for this?

  1. #1
    Join Date
    Mar 2003
    Location
    in a reinforced cardboard box floating over the ocean
    Posts
    25

    what would be easyer for this?

    Hi, i want to make a sort of like virtual pet that when a visiter stops by, they can feed it ect., and its mood would change if noone visits it for a while, or if too many people bother it it gets annoyed, ect, what would be the best thing for me to learn to program this in?

  2. #2
    Join Date
    Dec 2002
    Location
    Pleasanton, CA
    Posts
    2,132
    An interesting idea
    but you need to more clearly define how many images, what period of time, what makes it happy, sad, angry. Remember, different people will visit. Does a new image get shown to all (server-side script) or does each visitor get a unique image- set based on thier interaction. (cookie).

    Anything (almost) is possible. The problem is defining the problem.

  3. #3
    Join Date
    Mar 2003
    Location
    in a reinforced cardboard box floating over the ocean
    Posts
    25
    images- should be 12(normal, sad, happy, angry, annoyed, bored, wanderd off/hideing, sleeping, eating, playing with string, and chaseing something)
    i was wondering if like there could be options to do, like attempt to feed it,give it a string to play with, it would be server side script. lemme give an example:
    it sits on a page, if noone visits it for a while (say 2-3 hours) it gets annoyed/wanders off (blank image) for everyone that visits the page.
    then if someone trys to feed it, but someone just fed it, it would get annoyed at them and wander off for a little bit

    it would sorta be like a gigapet/tamagotchi that sits on the table and whoever wanders by could interact with it, except that its on a web page and wont beep at you till you get annoyed and mute the volume, lol. it would be a picture of a little cat type thing.

    sorta like this, but not this exactly, but a little bigger.
    http://www.boomspeed.com/eevailen/personal/sleeping.gif
    Last edited by eevailen; 04-03-2003 at 05:42 PM.

  4. #4
    Join Date
    Dec 2002
    Location
    Pleasanton, CA
    Posts
    2,132
    Firstly, do you know Perl? That's the server-side script I know best and is the one I would be able to help you with.
    Let me outline a word script for you to add to, modify, correct, or throw out.
    By the way, you can't feed an LCTT (little cat type thing) if it wanders off (blank image). LOL;

    V = visitor checks out your site (could be very short or long intervals)
    cs = center stage

    V, LCTT cs (doing what?)
    V, LCTT cs, 2sec gets annoyed, 2sec fades away (walks off means large animated gif OR DHTML OR both)
    V, LCTT cs, fed within 2sec, normal; fed again within 2sec, happy
    V, LCTT cs, happy, fed again, gets annoyed.
    and so on..
    This is the type of word script needed to get started. Keep in mind that horrizontal or vertical motion can be achieved by either an
    animated gif, or better, some DHTML.

    And all this has to be really detailed. Such a drag

  5. #5
    Join Date
    Mar 2003
    Location
    in a reinforced cardboard box floating over the ocean
    Posts
    25
    nope, dont know perl, but ill sure look into learning it.
    the only things i know right now is html and some css, lol, oh and a little javascript.
    know of any good books i should get to learn perl?

  6. #6
    Join Date
    Dec 2002
    Location
    Pleasanton, CA
    Posts
    2,132
    I woke up this morning with a LCTT jumping around in my brain and it occured to me that you don't really need a server-side script.
    Here's my thoughts...
    Since the site is not user specific, it doesn't really matter what a vistor initially sees as long as it's not always the same. So you will need to create a number of mini word scripts, with a beginning and an end, similar to those above. (the fewer the better; less coding). When a visitor arrives, one of these scripts will be randomly activated that will interact with the visitor. If you can prepare the word scripts, I will get you started on a relatively simple javascript/CSS/DHTML solution.

  7. #7
    Join Date
    Mar 2003
    Location
    in a reinforced cardboard box floating over the ocean
    Posts
    25
    what exactly would they need to look like? (cause im an idiot )
    Last edited by eevailen; 04-05-2003 at 01:24 AM.

  8. #8
    Join Date
    Dec 2002
    Location
    Pleasanton, CA
    Posts
    2,132
    Start with your 12 gifs, ([0] thru' [11]), each representing a mood. Some could also be animated gifs. Now you need the word script similar to those I suggested. Each script will start when someone visits the site. The actual script will randomly selected

    1. normal[0], click food, happy[1], click string, plays[2], 2sec, normal[0], 2sec, sad[3], click food...etc repeats maybe!
    2. bored[4], click string, angry[5], 3sec, walks-off[6].... etc
    3. sad[3], ...

    So each sequence will consist of multipule... gif, visitor-action, gif ..AND/OR.. gif, elapsed-time, gif. Make up, say 10, different scripts. One thing to remember, any elapsed time should be relatively short (I suggest 1 to 5 sec max) Of course, you could make just one long script and the entry point will be randomly selected. Either way the actual code is relatively simple.

    That's about as best as I can explain it.
    Programming is 1/3 planning, 1/3 coding, and 1/3 debugging

  9. #9
    Join Date
    Mar 2003
    Location
    in a reinforced cardboard box floating over the ocean
    Posts
    25
    ok, how are these?
    1. normal[0], click food, happy[1] click string, plays[2], 4sec, bored[3], 4 sec, click food, annoyed[4] 2 sec, walkaway, 7 sec, click ball, chase_ball[8], 5 sec,
    2. bored[3], click string, plays[2], 5 sec, click ignore, walkoff[5] 5 sec, click food, eat[6], 2 sec,
    3. sad[7], click string, plays[2], 1 sec, sad[7], click food, eat[6], 1 sec, click ignore, walkoff[5], 5 sec, annoyed[4],
    4. walkoff[5], click call, walkoff[5], 5 sec, happy[1], click ignore, walkoff[5], 1 sec, bored[3], click food, walkoff[5], 1 sec, eat [6], 3 sec,
    5. annoyed[4], click call, funny_look[10] 2 sec, click string, angry[9], 3 sec, click ball, chase_ball[8], 5 sec, happy[1],
    6. happy[1], click food, eat[1], 2 sec, happy, click string, play_string[2], 2 sec, happy[1], click call, funny_look[10], 1 sec, happy, click ball, chase_ball, 3 sec, happy,
    7. angry[9], click ignore, angry[9], 5 sec, happy, click food, angry[9], 5 sec, bored[3], click string, angry[9], click ball, angry[9]
    8. sleeping[11], click call, angry[9], click food, angry[9], click string, angry[9], click ball, angry[9], 5 sec, sleeping[11]
    9. play_string[2], click string, play_string[2], 5 sec, bored[3], click call, normal[0], click ball, normal, 2 sec, chase_ball[8], 5 sec, click ignore, play_string[2], 4 sec,
    Last edited by eevailen; 04-05-2003 at 02:45 AM.

  10. #10
    Join Date
    Dec 2002
    Location
    Pleasanton, CA
    Posts
    2,132

    Re-direct this thread to Javascript

    This has evolved to a javascript solution. continued here....
    http://forums.webdeveloper.com/showt...&threadid=7247

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles