Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Cubic Run - an endless runner
Started by Lerg Aug 23 2013 08:41 PM

28 replies to this topic
[TOPIC CONTROLS]
Page 1 of 2 1 2
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

Lerg

[GLOBAL: userInfoPane.html]
Lerg
  • Enterprise
  • PipPipPipPipPipPip
  • 92 posts
  • Jedi

Hi!

 

So I've managed to make a game in several hours! You play as a little cute cube, the goal is to not get collected by Cubester (thanks BatGirl). On your way you collect power ups for yourself. They are random and you might need to get several before you get any effect.

 

Powers are: leave a trail, make sparks, double and triple jump, gliding (hold to glide) and teleport (touch left side to quickly go down).

 

I hope you will like it.

 

The final version took me more than 4 hours, but I couldn't help it add extra eye pleasing effects to it.

So in 4 hours I had the whole gameplay implemented.

And I think extra 3 hours went to add parallax background, trail, sparks, stars, shading, color scheme fixing, high score, saving to a file and sounds.

 

I had some amount of code already ready (my own libs) and I really have been thinking about the concept before starting to code.

 

Funny thing it's my first project that uses Physics.

 

BSaIqlrCIAAzcJ1.png

 

 

Music by Riley Marengo.

 

I've compiled an APK. Go and play on your Android device

https://dl.dropboxusercontent.com/u/55969280/CubicRun.apk

 

Turns out trail makes my kindle fire lag a bit - added low performance detection and disabling trail smoothing.



[TOPIC: post.html]
#2

hyper

[GLOBAL: userInfoPane.html]
hyper
  • Starter
  • Pip
  • 3 posts
  • Newbie


[TOPIC: post.html]
#3

jonjonsson

[GLOBAL: userInfoPane.html]
jonjonsson
  • Pro
  • PipPipPipPipPipPip
  • 947 posts
  • Jedi

Looks great, reminds me of Impossible Game which is really good. I think yours looks even better with the parallax and all. Lots of potential.



[TOPIC: post.html]
#4

TozSoftware

[GLOBAL: userInfoPane.html]
TozSoftware
  • Pro
  • PipPipPipPipPipPip
  • 105 posts
  • Jedi

Very cool!  I like what you did with the rectangles for graphics!



[TOPIC: post.html]
#5

Lerg

[GLOBAL: userInfoPane.html]
Lerg
  • Enterprise
  • PipPipPipPipPipPip
  • 92 posts
  • Jedi

Added a link to an APK.



[TOPIC: post.html]
#6

brainofsteel

[GLOBAL: userInfoPane.html]
brainofsteel
  • Starter
  • PipPipPip
  • 36 posts
  • Advanced Member

Wow, this is really solid. Reminds me of Canabalt. I like how he went under the cube at the end. Post to the forum when you publish this, I want to play it!



[TOPIC: post.html]
#7

Lerg

[GLOBAL: userInfoPane.html]
Lerg
  • Enterprise
  • PipPipPipPipPipPip
  • 92 posts
  • Jedi

Wow, this is really solid. Reminds me of Canabalt. I like how he went under the cube at the end. Post to the forum when you publish this, I want to play it!

You can play it now! There is an APK included. I hope you have an Android device.



[TOPIC: post.html]
#8

Lerg

[GLOBAL: userInfoPane.html]
Lerg
  • Enterprise
  • PipPipPipPipPipPip
  • 92 posts
  • Jedi

So far only one person asked for the source. Don't be shy!



[TOPIC: post.html]
#9

eddierush

[GLOBAL: userInfoPane.html]
eddierush
  • Pro
  • PipPipPip
  • 41 posts
  • Advanced Member

WOW! That's Sweet! I enjoyed just watching the video. Imagine if I actually played the game :)



[TOPIC: post.html]
#10

dingo

[GLOBAL: userInfoPane.html]
dingo
  • Starter
  • PipPipPipPipPipPip
  • 666 posts
  • Jedi

the art really is great, honestly!



[TOPIC: post.html]
#11

karan@mobieos.com

[GLOBAL: userInfoPane.html]
karan@mobieos.com
  • Pro
  • Pip
  • 6 posts
  • Newbie

Great Fun watching the Video.. Congrats on the good work done ...



[TOPIC: post.html]
#12

cnmeyer1980

[GLOBAL: userInfoPane.html]
cnmeyer1980
  • Starter
  • PipPip
  • 24 posts
  • Member

wow! this looks amazing! very impressive (especially as I've spent ages trying to develop code even to this level) - so well done you :) I did (temporarily) give up with a game of this type and concentrated on my book/game app (which will be released in the next few weeks) - however I would LOVE to see your code (if thats ok?).

 

Thank you and hope to speak soon,

Chris



[TOPIC: post.html]
#13

Ninja Pig Studios

[GLOBAL: userInfoPane.html]
Ninja Pig Studios
  • Pro
  • PipPipPipPipPipPip
  • 571 posts
  • Jedi

Really nice work! Looks well optimized and looks like your using line append if I'm not mistaken?

 

Keep it up :D



[TOPIC: post.html]
#14

nicholasclayg

[GLOBAL: userInfoPane.html]
nicholasclayg
  • Pro
  • PipPipPipPipPipPip
  • 452 posts
  • Jedi

Lots of neat features in there, the one thing I'm interested in is the parallax. This is how I did it (I had a couple people help me out with it).

 

It scrolls some clouds, and it prevents repeats so the same cloud doesn't show up on the next frame. I'm getting towards the last stages of my game, and this was more of a polish element. I thought it be nice to not see a repeating texture (because I pay close attention to that in games, I can't help it).

 

 

What's not shown is there a local variable called scrollSpeed, which has a value assigned to it. I have about 5 of these code sets that divide the scroll speed so that each layer going towards the back is slower and slower for a nice effect.

 

However, even after tightening it up I'm always interested in how others accomplished the same thing. 

 

In other words, I'd like to see your fancy pants code :)

 

-Nick

 

 

--I copied and pasted this out of my project, hopefully I put everything in there. It's pretty straight forward, just looks a bit oddball (at least I think so).

local midScrollingBG        = display.newGroup()
local currentXM = 0
local prevXM    = 0


-----------------------------------------------------------------
---------------------Middle BG Scrolling Group loop--------------
-----------------------------------------------------------------
local lastNum2 = 0
local mRandom2 = math.random



--for loop to generate the far background pieces (aka nbg) pieces
for mbg = 1, 16 do 
    --make sure if you change 1, # - # being the number, you have to change
    --specifically here >  newX = midScrollingBG[#] -the# should match the for loop
    --Notice in this example it's 16, and in the updateMidScrollingBG() it's also 16.


--this picks a random number between 1 and 8, and if the next number is same 
--as last, then skip it until it's different
        repeat
            rNumMBG = mRandom2(8)
        until rNumMBG ~= lastNum2
            lastNum2 = rNumMBG


    local newMidBG = nil
    display.remove(newMidBG)
    
    newMidBG = display.newImageRect ("images/scrollingimages/cloud" .. rNumnbg .. "t.png", math.random (100,600), math.random(100,200))
    newMidBG.size = 1360 ; print(rNumMBG)

        currentXM= currentXM + prevXM*0.5 + newMidBG.size*0.5
        newMidBG.x = currentXM --(r * 100) - 100 
        newMidBG.y = math.random (50, 460)
        midScrollingBG:insert(newMidBG)
        prevXM = newMidBG.size
end

local function updateMid( event )
    updateMidScrollingBG()
end

function updateMidScrollingBG()
    for mbg = 1, midScrollingBG.numChildren do
        if(mbg > 1) then
            newX = midScrollingBG[mbg-1].x + midScrollingBG[mbg-1].size*0.5 + midScrollingBG[mbg].size*0.5--widthref
        else
            newX = midScrollingBG[16].x + midScrollingBG[16].size*0.5 + midScrollingBG[16].size*0.5 - speed --widthref
        end
        
        if(midScrollingBG[mbg].x < -1400) then --go with a larger piece to prevent pop in
            midScrollingBG[mbg].x, midScrollingBG[mbg].y = newX, midScrollingBG[mbg].y
        else
            midScrollingBG[mbg]:translate(scrollSpeed / 10000 * -1, 0)
        end
    end
end

timer.performWithDelay(1, updateMid, -1)


[TOPIC: post.html]
#15

Danny

[GLOBAL: userInfoPane.html]
Danny
  • Corona Staff
  • 2,312 posts
  • Jedi

Great work! From the video it looks like either you are very good at the game, or its a little easy :)

Impressive :)

[TOPIC: post.html]
#16

Elliott

[GLOBAL: userInfoPane.html]
Elliott
  • Starter
  • PipPipPip
  • 36 posts
  • Advanced Member

Very impressed, being able to review the source code would be much appreciated.

 

I'm especially interested on how you achieved the 'endless' part of the game i.e. is it random or is there some logic behind it?



[TOPIC: post.html]
#17

Lerg

[GLOBAL: userInfoPane.html]
Lerg
  • Enterprise
  • PipPipPipPipPipPip
  • 92 posts
  • Jedi

Really nice work! Looks well optimized and looks like your using line append if I'm not mistaken?

 

Keep it up :D

Thanks! No, I don't use line:append()



[TOPIC: post.html]
#18

Lerg

[GLOBAL: userInfoPane.html]
Lerg
  • Enterprise
  • PipPipPipPipPipPip
  • 92 posts
  • Jedi

Lots of neat features in there, the one thing I'm interested in is the parallax. This is how I did it (I had a couple people help me out with it).

 

In other words, I'd like to see your fancy pants code :)

 

Very impressed, being able to review the source code would be much appreciated.

 

I'm especially interested on how you achieved the 'endless' part of the game i.e. is it random or is there some logic behind it?

 

I've sent you the link for the source. Have fun!



[TOPIC: post.html]
#19

Lerg

[GLOBAL: userInfoPane.html]
Lerg
  • Enterprise
  • PipPipPipPipPipPip
  • 92 posts
  • Jedi

Great work! From the video it looks like either you are very good at the game, or its a little easy :)

Impressive :)

Thank you, Danny!
This version is easy, but there is another one, much harder. And yeah, I am good at it.

You can download android version here https://dl.dropboxusercontent.com/u/55969280/CubicRunLDMusic.apk
 



[TOPIC: post.html]
#20

roar.justnes

[GLOBAL: userInfoPane.html]
roar.justnes
  • Starter
  • Pip
  • 2 posts
  • Newbie

Really cool game and good graphic, would love to check out your source code. I'm thinking of making a endless runner game myself



[TOPIC: post.html]
#21

fabian.semal

[GLOBAL: userInfoPane.html]
fabian.semal
  • Basic
  • Pip
  • 1 posts
  • Newbie

Hello Lerg,

 

Very nice work here  :)

Could you send me the source code, it would be much appreciated.

 

Thx a lot,

 

Fabian



[TOPIC: post.html]
#22

johnlangone

[GLOBAL: userInfoPane.html]
johnlangone
  • Pro
  • PipPip
  • 13 posts
  • Member

Just an FYI to those looking to take a look at the source for Lerg's Endless Runner, check out the show notes for CoronaGeek #79

http://coronalabs.com/blog/coronageek/corona-geek-hangout-79/

 

 
And, as a special treat, Sergey Lerg offered to share the source code for his Cubic Run LD27 endless runner game with anyone who rates and reviews his Three Puzzle – Hex LED game for Android. If that’s you, then contact Sergey and let him know after you rate and review his app.

 

Lets support the community members who share their knowledge with others.



[TOPIC: post.html]
#23

ropetus98

[GLOBAL: userInfoPane.html]
ropetus98
  • Starter
  • Pip
  • 3 posts
  • Newbie

Great work!

Could you send me the source code, it would be much appreciated.

Thanks a lot.



[TOPIC: post.html]
#24

scoppingeliza

[GLOBAL: userInfoPane.html]
scoppingeliza
  • Starter
  • Pip
  • 4 posts
  • Newbie

So far only one person asked for the source. Don't be shy!

how to make those grund/wall lerg



[TOPIC: post.html]
#25

dariover

[GLOBAL: userInfoPane.html]
dariover
  • Starter
  • PipPip
  • 10 posts
  • Member

Wow, really amazing game, I'm just starting to learn both Corona and Lua coming from a Java world, do you think you could send me the source code as well? I'd love to learn from your awesome game.




[topic_controls]
Page 1 of 2 1 2
 
[/topic_controls]