I developed a quick game to play with my friends. The objective of the game is to see who presses the space bar the most times(we are very simple minded people). I made the app with node js and deployed it with heroku. The issue that I am having is that after a while of not being in use the variable for the top score resets. I don't really know how to fix this or even if there is a way to fix this but if you can help it would be much appreciated.
This is the url of the site if it helps
https://space-king.herokuapp.com/
I believe your app goes sleep after not receiving any traffic in 1 hour.
You can take a look at these links:
https://blog.heroku.com/app_sleeping_on_heroku
https://devcenter.heroku.com/articles/free-dyno-hours
Related
Am trying to create a chat application using Converse.js. As a student am trying to figure out where to start from in order to edit the code to suit my application. i can not figure out things like the entry point of the application.javascript. i need pointers. Looking for step by step video on youtube yields nothing meaningful for me, i can not find anything meaning full. The online documentation i think its for advanced users. Am looking for some sort of baby steps. what i want is able to edit the source code without a hustle
I tried running it on my localhost and and connecting. Wat am concerned about is editing the source code
this might be a really simple question but I couldn't find an answer out there on the internet.
I'm not sure how exactly to word this question because I don't know the terminology, so I will give some examples to demonstrate what I am talking about.
I am trying to make a web app that involves two users, user 1 and user 2. User 1 will answer a certain number of questions and user 2 will do the same (possibly concurrently), then they will both be shown which questions they answered identically. My problem is: how do I show the users the questions locally in a manner that if user 2 goes to the webapp at the same time user 1 is using it, the server won't show them the same page/question?
I basically want the web app to be like a shopping web app (like the Walgreens one for example) in the way that each user using it sees something different and not the same HTML page that everyone else would (as would be the case with the Walgreens homepage). How would I go about accomplishing this?
I am sorry for how vague this question is, I just completed this tutorial and realized that I was quickly running into the problem detailed above and have never independently made a web app before. Any help is appreciated!
EDIT: I am looking for a more generalized/conceptual answer to how to solve this problem, I would never expect someone to actually code this out for me.
I would use socket information in node js side to construct the page based on the user that ask the resource. :)
I am learning some web developing and though I could make a web game just to practice some more.
So far I have made this fancy roulette with js, html and css:
Codepen code
The question now is how do I make it real time? Been looking around but couldn't find the answer. Do I have to use web sockets? Node.js? I'm lost. I want it to look the same for everyone not individually different once you open it. A simple point out to where I should look next would be perfect.
Also I am running it through the web server that I bought. Thanks !
You can keep this application running in your webserver and stream the data using socket.io. Another option would be to use firebase.
first, I would like to apologize for my bad English, I hope you'll understand me!
So, I am making a video game (very original!) for a uni project. It is an online multiplayer game. I am using Meteor and Phaser.
It is basically a game in which you control a boat and you need to shoot on other players' boats.
My problem is that the other players positions doesn't update in real time on the client machine. Actually, the is a latency between 5 and 10 secondes (maybe more, I didn't timed it).
I think this is due to the way I update the position of other players. In my phaser main update loop, I update the database with the new position of the boat. I think the update function is called 60 times per second, it is quite a lot! I don't know if Meteor can handle so much updates in such a short time?
So this is how I update the database, then I need to update the other players position on the user machine.
For that, I have a subscription to the Boats collection, and I have an observeChanges function that update the position of the other players each time the database is changed.
I guess this is not the easiest way to do it, and not the most efficient!
My first idea was to use something like Meteor streams or Streamy, so that each user could broadcast constantly his position. But I read that Meteor streams is no longer updated, and I couldn't make Streamy work.
So my question is: what do you recommend to broadcast very (very) often datas to other users?
If I manage to do that, I think I can save boats datas in the database every 10 seconds for example.
Thank you :)
Again, I'm sorry for my english, I hope I made my problem understandable. Also, I am quite new to Meteor, so please don't judge me if I have very bad practices ^^
You have a couple of options here. The simplest may be running MongoDB completely in memory: http://edgystuff.tumblr.com/post/49304254688/how-to-use-mongodb-as-a-pure-in-memory-db-redis
Another option is to just use real Redis with Meteor. It would require running a Redis server of course. The learning curve on that may be higher than the option above.
https://github.com/meteor/redis-livedata
Finally, Meteor Streams looks like it would work though it looks like it would mean major changes to the structure of your game. http://arunoda.github.io/meteor-streams/
I'm a beginner in all things code, but am extremely interested in working with it. I am a photo student wanting to integrate digital media and my photographic processes. I was seeing if anyone had any advice for a problem I'm having. I started using Processing to achieve a "generation loss" compression effect to my photographs, and I want to move that to the web. So what I want to happen is every time someone goes to the specified web address, the application, will continue. For example, if I am the first user there, I see the first photograph in the sequence. If I am the 650th person, I see the 650th image. I was wondering if anyone had any suggestions, if I should continue trying to use Processing, or use a javascript, or any other means. Any help would be greatly appreciated! I can also post what I'm using in processing and such. Thanks so much in advance.
You have to break this down into a few pieces:
The first piece is the actual algorithm that "decays" an image based on some number. It sounds like you have that working.
The second piece is storing that number on a server somewhere so that it can be accessed and modified by various users over multiple sessions. It sounds like that's the part you're confused about.
There isn't a way to automagically store variables across multiple runs in a Processing sketch. After all, that entire thing is actually being run on the clients' computer! But what you can do is store the variable in a central location so that everybody can "share" that variable.
There are many ways to accomplish that, which is why people are saying your question is too vague. The most obvious solution would be to use a database, although using a database to store a single number might seem like overkill. You could also setup your web server to increment a number stored in a file every time the page is accessed.
Which approach you take depends on the setup of your program, web server, as well as your own comfort level with programming.
Good luck! It sounds like an interesting project.