Welcome to SomaliNet Forums, a friendly and gigantic Somali centric active community. Login to hide this block

You are currently viewing this page as a guest. By joining our community you will have the ability to post topics, ask questions, educate others, use the advanced search, subscribe to threads and access many, many other features. Registration is quick, simple and absolutely free. Join SomaliNet forums today! Please note that registered members with over 50 posts see no ads whatsoever! Are you new to SomaliNet? These forums with millions of posts are just one section of a much larger site. Just visit the front page and use the top links to explore deep into SomaliNet oasis, Somali singles, Somali business directory, Somali job bank and much more. Click here to login. If you need to reset your password, click here. If you have any problems with the registration process or your account login, please contact us.

LONG SERIES OF HTML5 GAMES: chapter1 part8

Qaybta Xirfada Sayniska iyo iwm

Moderators: Moderators, Junior Moderators

OUR SPONSOR: LOGIN TO HIDE
User avatar
afisoone
SomaliNet Super
SomaliNet Super
Posts: 5483
Joined: Wed Jul 22, 2009 9:46 pm
Location: We all want to become president even though Amisom controls Mogadishu

LONG SERIES OF HTML5 GAMES: chapter1 part8

Postby afisoone » Fri May 22, 2015 9:09 pm

Now the hardest part went. Everything else is easy..

Now let's answer what is screen wrapping?

Screen wrapping is when an image disappears one side and reemerges on the opposite side. That is what is called screen wrapping. ok

How do you do that in this arrow image... We need to add some codes functionka updateStageka();

open your Object.js file and let add some codes on updateStageka. Since our arrow image is running left to right we are going to add this
simple code..
function updateStageka()
{
window.requestAnimationFrame(updateStageka, canvaska);

arrow.x++;


if(arrow.x>canvaska.width)
{
arrow.x=0-arrow.width;
}



hadbaSawir();


}
Beautiful: Now what we said is simple. If the canvaska haduu dhaafo imageka. Then So gali the arrow image from the other side.

anagoo ku dhahnay
arrow.x=0-arrow.width;
Soo now let's watch what we did..here is the Demo

So now the image reappears again when it finishes the other end... Beautiful
---------------------------------------------------------------------------------------------------------------------

Here is the another question. Why the arrow Image is crossing the left of the canvaska.

How do we stop it?

We will next lesson inshallah!

<<Previous Lesson

OUR SPONSOR: LOGIN TO HIDE

Hello, Has your question been answered on this page? We hope yes. If not, you can start a new thread and post your question(s). It is free to join. You can also search our over a million pages (just scroll up and use our site-wide search box) or browse the forums.

  • Similar Topics
    Replies
    Views
    Last post

Return to “Careers - Engineering, Science & Computers”

Who is online

Users browsing this forum: No registered users and 2 guests