PDA

View Full Version : 7 Hours of learning jQuery = this.



LordDan
06-01-2010, 10:22 PM
Hey!

I just spent around 7 hours learning jQuery for the first time and ended up with an RPG World.
Quite surprised how easy jQuery is and how quickly I picked it up. My code is a bit messy but once I finish I should know enough to
be able to clean it up and improve on it more.

Anyway, I'm just interested to see what ya'll think of my noob start to jQuery. Also, if there is any
specific jQuery books on Amazon or any decent jQuery articles you think I could learn something from
please let me know. I want to continue to learn this stuff.

Here is the result of my learning: RPG World Map Prototype ('http://crikeygames.com.au/neab/EnchantedRPGEngine/WorldMapTest/test.html')
It's built up in layers:


Ground Layer (Terrain Tiles)
Objects Layer (Anything above terrain - Bushes/Signpost)
Player Sprite (Me/You, obviously)
Overhead Object Layer (Anything that needs to be above our sprite - walk around the lamp-post to see)
Events Layer (Trigger something - Step in "front" of the signpost to see)


It seems to work IE8, Firefox 2+, Opera 9+, Chrome, Safari 3+ - Only IE6/7 have positioning issues.

Movement: Arrow Keys (Will add WASD later)

Feedback? Remarks? Noob Bashes and Insults? :S

Djkanna
06-01-2010, 10:50 PM
Nice one :)

However it did nearly crash my browser on first load XD

Spudinski
06-01-2010, 11:31 PM
I would recommend "jQuery in action", it's a really good book.
Although, the project does look good.

LordDan
06-01-2010, 11:35 PM
Djkanna: Sound like I should look into some Preloading xD Cheers

Spudinski: Thanks! I'll see if I can find it on Amazon :thumbup:

LordDan
06-02-2010, 12:03 PM
I just added Wildlife (Birds) to the map, it looks good, but the sprite "sometimes" doesn't change so it looks like the birds are flying backwards on occasion. So far I only have basic direction detection. Can anyone with JS/jQuery knowledge think of anything to make the directions better? You can see the Birds yourself on the link in my original post.

curY and curX are the current tile position of the individual bird, they are simply grid ID's. (3x-5y, 6x-2y etc) newX and newY are then simply randomised.

[Edit: Fixed it, forgot to update curX and curY after the wildlife had finished it's movement. Could still be improved though]
[Edit: Completely fixed, the birds should fly around accurately now! :3]

[Credit: Wildlife inspired by a_bertrands NEAB]

DougK
06-15-2010, 12:51 PM
Your demo isn't working. I'm certainly interested as jQuery is one of the frameworks I've got on my list to look into for building a from-the-scratch game....

LordDan
06-15-2010, 07:01 PM
Your demo isn't working. I'm certainly interested as jQuery is one of the frameworks I've got on my list to look into for building a from-the-scratch game....

Yeah, I took it down because I am rebuilding it based on some advice from a_bertrand :)

DougK
06-16-2010, 02:56 AM
Cool, I will have to keep an eye open for when it comes back up.