Need direction advice on javascript project [closed] - javascript

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I’m working on a school project. It’s got to be done in about 10 weeks so I’ve got plenty of time to go about it. I’m very new to javascript so that explains why I’ve got so much time given for it. I’ve laid out a concept I feel passionate about and want to do it.
What I want from you guys are pointers, ideas or advice on what I should look into, maybe to do with specific functions or whatever, I’ll take any advice based on this concept.
The concept:
The project is a single page that shows a graphical design of the solar system. Planets that spin around the sun and there are two or three interactive options that I have to program.
They are:
When you click on the sun, the sun turns into a black hole that pulls on the revolving planets and they get drawn into the black hole with a nice little animation effect.
When you doubleclick on the sun, the sun disappears and the revolving planets are free from orbit and just float into outer space, outside of the canvas of the screen.
What would you say I should look into to realise this project. Again, I’m very new to javascript so that explains my asking. Thank you.

My first piece of advice is do not delay starting the project. Especially if you're new javascript (or programming in general, as sounds like might be the case?).
Besides that, there are a couple of things I can tell you're going to want to look at:
DOM events/event handlers
jQuery is a really spectacular javastript library that you will almost definitely want to use.
d3 is another library you may find helpful for your animations/drawings.
You may also find canvas helpful for drawing and animation.
Hopefully this points you in the right direction to start out.

Related

Simple Questions/Answer Games [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
Thank you for taking the time reading this!
A quick disclaimer, I have never coded anything in my life!
I know some basics terms so you can communicate your response without defining them.
Anyways, my project is a simple game.
You press [START]
You hear a "random" word
You have a type-in box,
if you fill it right you get +5 points and get a random word .... and so on.
You fill it wrong, you lose immediately [gameover]
Although, I would deeply appreciate to code the whole game, for some of you it is relatively simple - I wish to do it myself for the learning experience and sense of accomplishment!
For now, I only need a push in the right direction.
I aim to use it on my tablet or phone (both run android)
Best,
haz
You should start by learning the fundamentals of JavaScript and HTML (should also learn CSS if you want the app to look nice). There are many sites (other than SO) that have multiple tutorials and/or full documentation (i.e. MDN, W3Schools). You could also use online teaching platforms for that.
Here are a couple of things you should consider after getting a grasp of the basic concepts:
When do you want to check if the user inserted the right input (timer, on enter, a submit button)?
Where will the sounds be stored and how will you retrieve them (a collection of sounds of files, a database with a server, a single big sound file containing all of the words)?
Regardless of how you store the sounds you will need a way to map text to the sound and the random number (Math.random()) to one of the two.
Finally create a JavaScript function that resets the text and gets a new word every time the user gets the word right or when the initial start button is clicked.
Once you reach any questions on the actual coding, search for the problem in SO (odds are it has been asked before). If you can't find an answer to your question create a new question (you should read How to ask first).

Canvas games - is it worth learning? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I am very into creating a canvas game, but im not sure if its worth the effort, and this is why...
Flash has Adobe Flash which is an interface for creating very complex animations, games and apps.
So im sure that a program is soon to come where, making games and animation will not require anny coding skills, it will al be done via a graphical user interface, pushing buttons and such.
So i am afraid i will put all this time into something that evantually will not be even necesary to achive the same goal.
What do you people think?
Yes definitely worth learning. I don't believe any AAA games could ever be created without coding. Canvas is supported in all browsers and gives the users of your website a chance to try out something without fancy installations or crashed applications.
Canvas is also a good thing to put on your resume once you are good at it :)
Like someone else said, It's never a waste to learn something new.
Also, I think this question is more or opinion. If your trying to get a job on the server side for example: It may be more useful to learn some other server side technologies first.
I think that putting effort in learning is not useless, more if we are speaking about html5 canvas against flash whatever, because flash is dying and html5/css3/js is starting to rule in the same areas flash used to.
But more important is that you define if you want to develop a game or just make a game pointing and clicking

What is a good 2D grid-based path-finding algorithm? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
I'm currently writing a 2D game in Javascript using the HTML5 <canvas> element. It's coming along very nicely, but i have run into a problem.
The level design for my game is a grid (so path cost moving from one cell to the north/south/east/west cell is 1) with various obstacles occupying various locations in the grid – a lot like a maze, but with a lot more wiggle room. Each individual level is on the order of 400 × 200 cells.
I'm trying to implement an enemy that will seek out the player no matter where they might be, but i'm having trouble trying to translate one of the various path-finding algorithms to fit my situation. Most of the ones i've come across (like A* and Dijkstra) seem to be best suited to 3D or much more complicated 2D situations. I was wondering if it is possible to dramatically simplify these algorithms to better suit my purposes, or if something like the depth-first search would be a more efficient alternative given the level size.
A* is a very common 2D pathfinding algorithm. It might take a little time to wrap your head around what's happening if pathfinding is unfamiliar, but it's not terribly complex. You may just be looking at someone else's example code that's been developed for a more complex application than you intend. There's a good tutorial for understanding the algorithm here.
Check this out https://github.com/qiao/PathFinding.js It has a lot of demos and path finding algothms.
EasyStar.js is a nice looking library that appears to do what you'd like to. I haven't used it myself, but the documentation on the project's github page looks pretty good, and it's probably what I would choose in your position.

Having real trouble learning programming [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
Let me preface by saying I do apologise if this is off-topic, I just want to get some pointers on where to head with this.
I desperately want to be good at programming, I'm a 28 year old designer and want to head in a more technical direction but I'm really struggling. My goals are to work ideally with Ruby/Rails or similar with the ability to build full apps.
I've been using HTML/CSS as a designer for years so that's fine, but I've spent the last three months learning JavaScript and I just can't seem to actually make stuff with it. I've read multiple books, been through CodeAcademy and I get it, I understand the syntax, patterns and such when it's presented before me, but when it comes to actually making something happen on my own, I draw a blank. Tried making a quiz, can't even work out where to begin.
Seriously, the most exciting thing I can do is validate one form field or something. It's been 3 months, I feel like I should be way further in than this, otherwise I'm never going to get into Rails or any other language.
Any ideas?
Thanks
Learn some server side programming and then the javascript will more likely fall into place as you will find a real use for it. Start simple, like creating a page that lists items from a single table in a database. That will get you the basics, then start adding some frills using javascript, like sorting the columns, deleting rows, etc.
Good luck and don't give up!
Pete

What sort of user interface would you use for this? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
I'm trying to make a user interface that would do the following but I'm clueless as to how to do it.
The problem is this, I want to let people allocate a percentage of their account balance to different thing, say you want to allocate 40% to rent, 30% for savings and 30% to everything else
How would you let people choose the percentage between these things?
the problem is the total percentage will have to be 100% all the time, so say you want to put 3 textboxes on the page each indicating the ratio,
If the user chooses 80% for the first one and 20% for the next one, then the last one must remain 0, it's an awkward user interface and considering how little attention Internet users give to the pages the browse, I don't think anyone will fully understand and use it...
I was thinking about sliders like an audio equalizer, but even that is hard to make sense out of.
A pie chart of some kind that can let you change the values by clicking on the pie chart would probably be a good idea, but very hard to implement in js.
Let me know what you think
Disk partitioning tools address the same problem I think, with their visualisation of available space, partitions inside it, unpartitioned space, etc. Have you ever used anything like Partition Magic or similar?
But - yes, it's quite challenging UI to create in JavaScript, but still doable.
How about three slider bars that update each other?
Or How about an Interactive Pie Chart?
My vote is for sliders that update in real time; slider A is grabbed and, when changed, updates sliders B and C. You can have a pie chart update as well to reinforce what's going on.

Categories