I’m trying to make my character not leave the screen, putting a limit value left and right. But this value is varying a little making it pass the screen and I do not know why.
Could you please help me?
Thank you so much.
Follow the code:
Var SJogador = pc.createScript (‘sGamer’);
Var speed = 3;
// initialize code called once per entity
Splay.prototype.initialize = function () {
};
// update code called every frame
SJogador.prototype.update = function (dt) {
Questions you ask are due to lack of general knowledge in development. Development - is not easy job, you need to be determined, and work hard. It is a lot of investigation and learning to think like developer. Don’t rush this process, you need to learn how to learn - this is most important skill.
Asking every single task on forum - will not help you much, because you need to be able to solve such problems yourself.
You’re right…
I was a long time away from programming and I lost practice …
I wanted to at least have a base to start over and start creating my own codes …
I have already researched the tutorials but I can not find anything like a simple 2d platform game … With jump, gravity and etc … The closest is the Flappy Bird however there is no jump system …