Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    New Coder
    Join Date
    Nov 2002
    Posts
    87
    Thanks
    0
    Thanked 0 Times in 0 Posts

    My first JavaScript...

    I would like to make a web page that will show the results of a battle for a game I'm working on.

    The page would have some small .jpgs that need to move around to replay the actions and movements of characters in the fight.

    Can I use javascript to move images on the client display this way?

    If so is there already a script that does this kind of thing or can someone give me an example of the code to use?

  • #2
    Regular Coder
    Join Date
    Aug 2002
    Location
    Silicon Valley, CA
    Posts
    980
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Well, your question is a bit vague. To give you a short answer, yes it can be done.

    As far as how to do it, well, that's a project-specific task.

  • #3
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Agreed. I do, however, have a rudimentary Animation class you can use.
    My Site | fValidate | My Brainbench | MSDN | Gecko | xBrowser DOM | PHP | Ars | PVP
    “Minds are like parachutes. They don't work unless they are open”
    “Maturity is simply knowing when to not be immature”

  • #4
    Regular Coder
    Join Date
    Nov 2002
    Posts
    672
    Thanks
    1
    Thanked 1 Time in 1 Post
    Oh my... So now extenal javascript files are being refered to as classes? This is not looking very friendly for people that don't know the difference between java and javascript (me being one of those with no java compiler or experience with it). Is that all they are? Fancy naming? Or does javascript also have classes as a real name for something?

  • #5
    Master Coder
    Join Date
    Feb 2003
    Location
    Umeå, Sweden
    Posts
    5,575
    Thanks
    0
    Thanked 83 Times in 74 Posts
    No... constructors are being referred to as classes - because that is quite close to the truth, and it's a familiar concept for anyone used to other object oriented languages, that doesn't work through the prototype-based inheritance. (In fact prototype-based inheritance can fully emulate class-based, while the opposite isn't always true.)
    liorean <[lio@wg]>
    Articles: RegEx evolt wsabstract , Named Arguments
    Useful Threads: JavaScript Docs & Refs, FAQ - HTML & CSS Docs, FAQ - XML Doc & Refs
    Moz: JavaScript DOM Interfaces MSDN: JScript DHTML KDE: KJS KHTML Opera: Standards

  • #6
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Right, I happen to have it saved as an external file, but just being an external file doesn't make it a class.

    A class is basically a way to group data and the logic that processes that data together into objects. Grouping them meaning encapsulating them from the rest of your code (which could be other classes)
    My Site | fValidate | My Brainbench | MSDN | Gecko | xBrowser DOM | PHP | Ars | PVP
    “Minds are like parachutes. They don't work unless they are open”
    “Maturity is simply knowing when to not be immature”

  • #7
    Regular Coder
    Join Date
    Nov 2002
    Posts
    672
    Thanks
    1
    Thanked 1 Time in 1 Post
    So you mean that if I make my own collapsing menu script and make it all externally for means to be used as a common gui on my site, I may as well call it a class? Or is it much more?

  • #8
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts
    No, you may not as well call it a class. A class is in reference to creating custom javascript objects that do a specific task. Look at the source code for any of my javascript classes and you will see they are all built roughly the same. A constructor function with prototyped methods. There's nothing creating, handled, or otherwise manipulated outside the object. THis is the basis for a class, and as liorean pointed out, that is a familiar term for objects done like this.
    My Site | fValidate | My Brainbench | MSDN | Gecko | xBrowser DOM | PHP | Ars | PVP
    “Minds are like parachutes. They don't work unless they are open”
    “Maturity is simply knowing when to not be immature”

  • #9
    Regular Coder
    Join Date
    Nov 2002
    Posts
    672
    Thanks
    1
    Thanked 1 Time in 1 Post
    I'm confused, I'm sticking with regular javascript stuff. I never even learned constructor stuff. And I can't upgrade to Internet explorer 6 without a good internet connection since microsoft doesn't have a redlist download for it. The most up to date version I've ever found distributed on a cd was Internet explorer 4. And their support sucks, I'm pissed at them.

  • #10
    Master Coder
    Join Date
    Feb 2003
    Location
    Umeå, Sweden
    Posts
    5,575
    Thanks
    0
    Thanked 83 Times in 74 Posts
    Ask a friend with a faster connection or something to download it...

    <http://browsers.evolt.org/?ie/32bit/6.0> (~70 MB, so it's not small)
    liorean <[lio@wg]>
    Articles: RegEx evolt wsabstract , Named Arguments
    Useful Threads: JavaScript Docs & Refs, FAQ - HTML & CSS Docs, FAQ - XML Doc & Refs
    Moz: JavaScript DOM Interfaces MSDN: JScript DHTML KDE: KJS KHTML Opera: Standards

  • #11
    New Coder
    Join Date
    Nov 2002
    Posts
    87
    Thanks
    0
    Thanked 0 Times in 0 Posts
    More info for those trying to help (thanks bty!)

    I have top down pictures of a landscape.

    I can track a players movement in game (Neverwinter Nights) and save those locations to a database (MySql).

    What I end up with is a log of locations at different points in time of where players and bad guys are.

    What I am trying to do is output that info to a webpage using PhP to pull the data from the database.

    I can get all that raw movement data into the webpage,
    now what i need is to use javascript to make some jpgs move over the map the way my players did.

    I hope this answered some of your questions. If not ask and I will try again.
    Thanks!

  • #12
    Regular Coder
    Join Date
    Nov 2002
    Posts
    672
    Thanks
    1
    Thanked 1 Time in 1 Post

    Unhappy

    No, I can never win. My computer is a compaq. They scam people. So far, my computer is less than 3 years old and it has a broken modem, broken cd-rom drive, broken hard drive, incompatible sound card, and stubborn mouse. My old DOS computer that is older than I am is in better shape, flawless. So there's nothing I can do. I can't even get a new one because I don't know the first thing about credit cards.

  • #13
    Master Coder
    Join Date
    Feb 2003
    Location
    Umeå, Sweden
    Posts
    5,575
    Thanks
    0
    Thanked 83 Times in 74 Posts
    Oh, you don't need a credit card - you can open the box with a regular screwdriver

    Then you just put in an old harddrive that one of your friends has discarded because it was too old - and see to it that your friend has put IE6 on it.

    (At least that's how it often works in the student world, for those that can't or don't want to buy new stuff.)
    liorean <[lio@wg]>
    Articles: RegEx evolt wsabstract , Named Arguments
    Useful Threads: JavaScript Docs & Refs, FAQ - HTML & CSS Docs, FAQ - XML Doc & Refs
    Moz: JavaScript DOM Interfaces MSDN: JScript DHTML KDE: KJS KHTML Opera: Standards

  • #14
    Regular Coder
    Join Date
    Nov 2002
    Posts
    672
    Thanks
    1
    Thanked 1 Time in 1 Post
    no, everything on that machine is either dead or close to it. I need a whole new system and I can't even get a checking account let alone a credit card.

  • #15
    Senior Coder
    Join Date
    Jun 2002
    Location
    41° 8' 52" N -95° 53' 31" W
    Posts
    3,660
    Thanks
    0
    Thanked 0 Times in 0 Posts
    To tails:

    1. Why can't you get a checking account? Have someone you trust (like a parent, perhaps) open it with you?

    P.S. This shouldn't be in this thread, if you have further comments along those lines please post them uhh (no Webmaster Pit... sigh) ... perhaps the Computer/PC issues forum? Although I can share your frustration considering my somewhat troubled past (don't ask!).

    2. Build your own computer (old compaq computers used proprietary hardware, that's why they stink - you couldn't upgrade them!).

    Last edited by whammy; 04-03-2003 at 02:29 AM.
    Former ASP Forum Moderator - I'm back!

    If you can teach yourself how to learn, you can learn anything. ;)


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

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