Posted 10 March 2012 - 08:51 PM (#21)
We all die. The goal isn't to live forever. The goal is to create something that will.
Array(16).join({}-{}) + " Batman!";
Posted 10 March 2012 - 11:53 PM (#22)
ThatRailsGuy, on 10 March 2012 - 12:55 PM, said:
$('#bar1').width('5%');
Function $(id) { return document.getElementById(id); }
$('bar1').style.width = '5%'That's just inline CSS anyways. It's just setting it via JavaScript. If the percentage was set server-side, setting it via inline CSS is fine. why use JS for that?

Repeat after me: jQuery is not JavaScript. It is not the answer to every JavaScript-related question. When you have to write some JavaScript, do not instantly react with "Oh, I'll do that with jQuery!"
Posted 11 March 2012 - 12:15 AM (#23)
Daniel15, on 10 March 2012 - 11:53 PM, said:
Function $(id) { return document.getElementById(id); }
$('bar1').style.width = '5%'That's just inline CSS anyways. It's just setting it via JavaScript. If the percentage was set server-side, setting it via inline CSS is fine. why use JS for that?
If he's making a game, probably want to use AJAX and thus JS to update.
Posted 11 March 2012 - 04:16 AM (#24)
ThatRailsGuy, on 10 March 2012 - 06:50 PM, said:
hint: it's even easier to just write that single inline css expression
a hoopy frood who really knows where his towel is. ~~~ gibbonweb | github | hdr photographymy wife has a new DIY/decorations/floristry blog, wanna take a look? (stay tuned for English translations...)
Posted 11 March 2012 - 09:13 AM (#25)
Renegade, on 10 March 2012 - 08:17 PM, said:
Warning: It is extremely painful watching that moving progress bar.
The moving stripes slowly speed up
Posted 12 March 2012 - 02:57 PM (#26)
Thank you for all of the code examples; They were basically what I was looking for.
I am planning on using AJAX and JS for my fan made Pokemon Game. Right now I am working on the battle code which is proving to be the most arduous part of the whole game.
Since I have never really used javascript, I am hard at work learning it so that I can make the battles have real time updates and effects rather than using server side PHP alone.
The Battle System will take a lot of work, but this was a good first step towards completing it.
Posted 12 March 2012 - 03:04 PM (#27)
Sole_Wolf, on 12 March 2012 - 02:57 PM, said:
Thank you for all of the code examples; They were basically what I was looking for.
I am planning on using AJAX and JS for my fan made Pokemon Game. Right now I am working on the battle code which is proving to be the most arduous part of the whole game.
Since I have never really used javascript, I am hard at work learning it so that I can make the battles have real time updates and effects rather than using server side PHP alone.
The Battle System will take a lot of work, but this was a good first step towards completing it.
Before you put any huge effort in it: don't code the actual game logic in JavaScript, as players will be able to cheat (they can see the JS code and write variables via the Console...)... Always make sure your business logic is synchronized with the server, I'd very well UPDATE the screen in real time via javascript, but calculate the game mechanics in PHP (or whatever - SERVER SIDE) and just distribute the results to every client.
a hoopy frood who really knows where his towel is. ~~~ gibbonweb | github | hdr photographymy wife has a new DIY/decorations/floristry blog, wanna take a look? (stay tuned for English translations...)
Posted 13 March 2012 - 03:15 PM (#28)
gibbonweb, on 12 March 2012 - 03:04 PM, said:
I have all of the game mechanics programmed in PHP. Currently, I am planning on just using AJAX to call my PHP functions to get damage calculations and other things like that for the battle system.
Anyone know a good place to start with AJAX? RIght now I am reading up on javascript from w3schools.
Posted 13 March 2012 - 03:32 PM (#30)
Sole_Wolf, on 13 March 2012 - 03:15 PM, said:
Anyone know a good place to start with AJAX? RIght now I am reading up on javascript from w3schools.
in that case, spare yourself some pain and use a good ajax capable framework.
a hoopy frood who really knows where his towel is. ~~~ gibbonweb | github | hdr photographymy wife has a new DIY/decorations/floristry blog, wanna take a look? (stay tuned for English translations...)
Posted 14 March 2012 - 02:14 AM (#31)
gibbonweb, on 13 March 2012 - 03:32 PM, said:
I'll probably end up using an ajax framework but I also need some javascript experience.
After modifying everyone else's code to my liking, this is my 1st draft for a Pokemon Party View.
Posted 14 March 2012 - 02:33 AM (#32)
Sole_Wolf, on 14 March 2012 - 02:14 AM, said:
After modifying everyone else's code to my liking, this is my 1st draft for a Pokemon Party View.

cool! But what's with the last pokemon's health... doping?
a hoopy frood who really knows where his towel is. ~~~ gibbonweb | github | hdr photographymy wife has a new DIY/decorations/floristry blog, wanna take a look? (stay tuned for English translations...)
Posted 14 March 2012 - 02:46 AM (#34)
gibbonweb, on 14 March 2012 - 02:33 AM, said:
I was just playing around with numbers to see what the effect of having negative health and more than max health would have on my hp bar function.
ThatRailsGuy, on 14 March 2012 - 02:39 AM, said:
Yes correct! I am adding glitches to the game
Did anyone notice the Magikarp named Lugia?
Posted 14 March 2012 - 03:02 AM (#35)
Sole_Wolf, on 14 March 2012 - 02:46 AM, said:
to be honest, Pikachu is the only Pokémon I would recognize by name, and that's quite alright with me
a hoopy frood who really knows where his towel is. ~~~ gibbonweb | github | hdr photographymy wife has a new DIY/decorations/floristry blog, wanna take a look? (stay tuned for English translations...)
Posted 14 March 2012 - 11:24 AM (#36)
Sole_Wolf, on 14 March 2012 - 02:46 AM, said:
I did, but didn't get it.
Posted 14 March 2012 - 12:08 PM (#37)
overflow: hidden;to the parent div to fix that health bug






Cartoon Clouds
Mountains
Sunrise
Clouds
Green Clouds
None





















Help