Like SystemiConnectFri 15 Oct 2021, 04:50
Auto Save MessagesLGforumFri 26 Feb 2021, 13:31
New tutorial questionTheCrowMon 15 Feb 2021, 08:12
Support iOS Emojis (and other platforms)LGforumSun 14 Feb 2021, 01:25
LGforum (2806)
Topics tagged under 2 on AvacWeb Vote_lcapTopics tagged under 2 on AvacWeb Voting_barTopics tagged under 2 on AvacWeb Vote_rcap 
Mr.Easybb (1587)
Topics tagged under 2 on AvacWeb Vote_lcapTopics tagged under 2 on AvacWeb Voting_barTopics tagged under 2 on AvacWeb Vote_rcap 
Bloodbath (745)
Topics tagged under 2 on AvacWeb Vote_lcapTopics tagged under 2 on AvacWeb Voting_barTopics tagged under 2 on AvacWeb Vote_rcap 
Rukiafan (533)
Topics tagged under 2 on AvacWeb Vote_lcapTopics tagged under 2 on AvacWeb Voting_barTopics tagged under 2 on AvacWeb Vote_rcap 
Dom (513)
Topics tagged under 2 on AvacWeb Vote_lcapTopics tagged under 2 on AvacWeb Voting_barTopics tagged under 2 on AvacWeb Vote_rcap 
puppycheese (446)
Topics tagged under 2 on AvacWeb Vote_lcapTopics tagged under 2 on AvacWeb Voting_barTopics tagged under 2 on AvacWeb Vote_rcap 
pedro (330)
Topics tagged under 2 on AvacWeb Vote_lcapTopics tagged under 2 on AvacWeb Voting_barTopics tagged under 2 on AvacWeb Vote_rcap 
Neymar (301)
Topics tagged under 2 on AvacWeb Vote_lcapTopics tagged under 2 on AvacWeb Voting_barTopics tagged under 2 on AvacWeb Vote_rcap 
Hitsu (281)
Topics tagged under 2 on AvacWeb Vote_lcapTopics tagged under 2 on AvacWeb Voting_barTopics tagged under 2 on AvacWeb Vote_rcap 
Flora (275)
Topics tagged under 2 on AvacWeb Vote_lcapTopics tagged under 2 on AvacWeb Voting_barTopics tagged under 2 on AvacWeb Vote_rcap 

Search found 1 match for 2

Hitsu
Search in: JavaScript & JQuery
Topic: Virtual Pet
Virtual Pet
on Sun 15 Jan 2017, 09:13 by Hitsu
Ok so,
Version #1 or version #2? Which is better?
I don't think I can evaluate which is better correctly, because the purposes are all the same. You started on the basic informations, like the name, gender, type, age, and all infos about your pet. You do activities with your pet, and all of it remains the same. And I think, if only you build on a HTML5 mini-game, it'll be much and much more simple rather than having a buncha prompts, confirms, arrays, and any basic configurations. But ah well, nevermind.

Honestly, I do think that Version #2 is better. A lot more simpler I think, w/o annoying prompts and anything like that.


Oh and, there's a little bit error w/ the version #1.
In this bit:
Code:
[panda=js]if(prom3.toLowerCase() != "male" || prom3.toLowerCase() != "female") alert("Invalid gender.");
pet.gender = prom3;

I do type "Female" and it'd still returns "Invalid gender."
And, even if the gender of the pet was invalid, you'd still input the wrong gender inside of the object.

Also
Code:
[panda=js]var prom4 = prompt("Enter your pet's age!");
pet.age = prom4;

Put an if condition here. You don't want someone to type "999" and the program inputs it inside the data right? That, might be fatal.
Forum: JavaScript & JQuery | Topic: Virtual Pet
Back to top