i just wanted to seriously know that how to make screen things close…For example…in doodle jump game…when our player jumps, the base like things come closer and a new platform is make…and in mario when we move ahead…new things appear…so the thing is that how this things appear when we only had a single page game…does it requires some special coding
It requires coding, but not special. The concept is fairly basic. You simply create new content off-screen and bring it on as needed.
You should read up on the concept of cameras, and dig through these archives (there many many examples and many of them cover parts of your questions):
- http://github.com/roaminggamer/RG_FreeStuff (pay special attention to the content under AskEd)
- http://github.com/roaminggamer/CoronaGeek
This is the case of parallax scrolling. It means scrolling background
You can find many tutorials
This is the series of tutorial in which game is made using parallax scrolling. It is created by Mark Falkland
https://www.youtube.com/watch?v=0GtUxdSeWzk&list=PLfjNlDrVXRK0NVKsqHgbG9RdOTp5K3Pos
and many more! just google “corona sdk parallax scrolling”
No special coding required, this is how I did mine, it is multilayered:
local horizon local horizon2 local mountainback local mountainback2 horizon = display.newImageRect("Sprite Sheets and Projects/Mountains/PALALLAX/horizon(5).png", 1425, 950) horizon.x = \_CX horizon.y = \_CY horizon.value = 0.2 horizon2 = display.newImageRect("Sprite Sheets and Projects/Mountains/PALALLAX/horizon(5).png", 1425, 950) horizon2.x = horizon.width \* --whatever number(this is layer is placed off screen) horizon2.y = \_CY horizon2.value = 0.2 mountainback = display.newImageRect("Sprite Sheets and Projects/Mountains/PALALLAX/mountainback(4).png", 1425, 950) mountainback.x = \_CX mountainback.y = \_CY mountainback.value = 0.4 mountainback2 = display.newImageRect("Sprite Sheets and Projects/Mountains/PALALLAX/mountainback(4).png", 1425, 950) mountainback2.x = mountainback.width \* --whatever number(this is layer is placed off screen) mountainback2.y = \_CY mountainback2.value = 0.4 function scrollMountains(self,event) if self.x \< -self.width \* --whatever number then self.x = self.width \* --whatever number else self.x = self.x - self.value end end horizon.enterFrame = scrollMountains Runtime:addEventListener("enterFrame", horizon) horizon2.enterFrame = scrollMountains Runtime:addEventListener("enterFrame", horizon2) mountainback.enterFrame = scrollMountains Runtime:addEventListener("enterFrame", mountainback) mountainback2.enterFrame = scrollMountains Runtime:addEventListener("enterFrame", mountainback2)
Ok but what about Mario…when he moves ahead new enemies and bridges type things appear …what about them…??..if parallel scrolling is the thing then opponents must come back itself but in super mario only when we move than only things appear…soo should be have to make a more than one page game?? or what…i am confusing…is there anyone who can contact me or video chat with me?
Ok but what about Mario…when he moves ahead new enemies and bridges type things appear …what about them…??..if parallel scrolling is the thing then opponents must come back itself but in super mario only when we move than only things appear…soo should be have to make a more than one page game?? or what…i am confusing…is there anyone who can contact me or video chat with me?
thanx but tell me the meaning of
function scrollMountains(self,event)
if self.x < -self.width * --whatever number then
self.x = self.width * --whatever number
else
self.x = self.x - self.value
end
end
and
enterframe
The function scrollMountains is to move one image after the other. It checks if the image is off screen and if it is it will place it back on screen. I recommend these numbers:
function scrollMountains(self,event) if self.x \< -self.width \* 0.6 then self.x = self.width \* 1.32 else self.x = self.x - self.value end end
Enterframe is just to make it repeat forever.
Value controls the speed.
horizon = display.newImageRect("Sprite Sheets and Projects/Mountains/PALALLAX/horizon(5).png", 1425, 950) horizon.x = \_CX horizon.y = \_CY horizon.value = 0.2 horizon2 = display.newImageRect("Sprite Sheets and Projects/Mountains/PALALLAX/horizon(5).png", 1425, 950) horizon2.x = horizon.width \* --whatever number(this is layer is placed off screen) 1.4 recommended horizon2.y = \_CY horizon2.value = 0.2 mountainback = display.newImageRect("Sprite Sheets and Projects/Mountains/PALALLAX/mountainback(4).png", 1425, 950) mountainback.x = \_CX mountainback.y = \_CY mountainback.value = 0.4 mountainback2 = display.newImageRect("Sprite Sheets and Projects/Mountains/PALALLAX/mountainback(4).png", 1425, 950) mountainback2.x = mountainback.width \* --whatever number(this is layer is placed off screen) 1.4 recommended mountainback2.y = \_CY mountainback2.value = 0.4
This is not the exact answer but it can get you started.
It requires coding, but not special. The concept is fairly basic. You simply create new content off-screen and bring it on as needed.
You should read up on the concept of cameras, and dig through these archives (there many many examples and many of them cover parts of your questions):
- http://github.com/roaminggamer/RG_FreeStuff (pay special attention to the content under AskEd)
- http://github.com/roaminggamer/CoronaGeek
This is the case of parallax scrolling. It means scrolling background
You can find many tutorials
This is the series of tutorial in which game is made using parallax scrolling. It is created by Mark Falkland
https://www.youtube.com/watch?v=0GtUxdSeWzk&list=PLfjNlDrVXRK0NVKsqHgbG9RdOTp5K3Pos
and many more! just google “corona sdk parallax scrolling”
No special coding required, this is how I did mine, it is multilayered:
local horizon local horizon2 local mountainback local mountainback2 horizon = display.newImageRect("Sprite Sheets and Projects/Mountains/PALALLAX/horizon(5).png", 1425, 950) horizon.x = \_CX horizon.y = \_CY horizon.value = 0.2 horizon2 = display.newImageRect("Sprite Sheets and Projects/Mountains/PALALLAX/horizon(5).png", 1425, 950) horizon2.x = horizon.width \* --whatever number(this is layer is placed off screen) horizon2.y = \_CY horizon2.value = 0.2 mountainback = display.newImageRect("Sprite Sheets and Projects/Mountains/PALALLAX/mountainback(4).png", 1425, 950) mountainback.x = \_CX mountainback.y = \_CY mountainback.value = 0.4 mountainback2 = display.newImageRect("Sprite Sheets and Projects/Mountains/PALALLAX/mountainback(4).png", 1425, 950) mountainback2.x = mountainback.width \* --whatever number(this is layer is placed off screen) mountainback2.y = \_CY mountainback2.value = 0.4 function scrollMountains(self,event) if self.x \< -self.width \* --whatever number then self.x = self.width \* --whatever number else self.x = self.x - self.value end end horizon.enterFrame = scrollMountains Runtime:addEventListener("enterFrame", horizon) horizon2.enterFrame = scrollMountains Runtime:addEventListener("enterFrame", horizon2) mountainback.enterFrame = scrollMountains Runtime:addEventListener("enterFrame", mountainback) mountainback2.enterFrame = scrollMountains Runtime:addEventListener("enterFrame", mountainback2)
Ok but what about Mario…when he moves ahead new enemies and bridges type things appear …what about them…??..if parallel scrolling is the thing then opponents must come back itself but in super mario only when we move than only things appear…soo should be have to make a more than one page game?? or what…i am confusing…is there anyone who can contact me or video chat with me?
Ok but what about Mario…when he moves ahead new enemies and bridges type things appear …what about them…??..if parallel scrolling is the thing then opponents must come back itself but in super mario only when we move than only things appear…soo should be have to make a more than one page game?? or what…i am confusing…is there anyone who can contact me or video chat with me?
thanx but tell me the meaning of
function scrollMountains(self,event)
if self.x < -self.width * --whatever number then
self.x = self.width * --whatever number
else
self.x = self.x - self.value
end
end
and
enterframe
The function scrollMountains is to move one image after the other. It checks if the image is off screen and if it is it will place it back on screen. I recommend these numbers:
function scrollMountains(self,event) if self.x \< -self.width \* 0.6 then self.x = self.width \* 1.32 else self.x = self.x - self.value end end
Enterframe is just to make it repeat forever.
Value controls the speed.
horizon = display.newImageRect("Sprite Sheets and Projects/Mountains/PALALLAX/horizon(5).png", 1425, 950) horizon.x = \_CX horizon.y = \_CY horizon.value = 0.2 horizon2 = display.newImageRect("Sprite Sheets and Projects/Mountains/PALALLAX/horizon(5).png", 1425, 950) horizon2.x = horizon.width \* --whatever number(this is layer is placed off screen) 1.4 recommended horizon2.y = \_CY horizon2.value = 0.2 mountainback = display.newImageRect("Sprite Sheets and Projects/Mountains/PALALLAX/mountainback(4).png", 1425, 950) mountainback.x = \_CX mountainback.y = \_CY mountainback.value = 0.4 mountainback2 = display.newImageRect("Sprite Sheets and Projects/Mountains/PALALLAX/mountainback(4).png", 1425, 950) mountainback2.x = mountainback.width \* --whatever number(this is layer is placed off screen) 1.4 recommended mountainback2.y = \_CY mountainback2.value = 0.4
This is not the exact answer but it can get you started.