sprite kit - Drawing continuous lines on Xcode/Unity -


i making app draws continuous lines snake using unity , skspritekit (obj-c) in xcode (i’m making 2 versions of same app in both):

http://i.stack.imgur.com/qa1zk.png

http://i.stack.imgur.com/484kj.png

http:// i.stack.imgur.com/qtekc.png (apologies image posts. can't post image/more 2 links)

if you’ve ever heard of game called curve fever, i’m doing here quite similar it. i’m controlling direction of end of line arrowkeys, whilst end of line automatically moves forward every frame creating image 1 above.

however, 3 screenshots above, quite obvious program isn’t efficient - every frame, add circle sprite skscene in place moving sprite is, why, after while, there on 1000 nodes on screen, , energy impact/memory/cpu high… not ideal.

so i’m looking better ways of drawing line on screen without drawing thousands of nodes.

a while ago, friend talked me how made similar app in gamemaker (which have no knowledge of how use). when asked him how rendered line, said created called “surface”, , when moved on surface, old position of sprite still stay there - create lines if circle moved across surface.

he rather vague this, , tried research later, no success. couldn’t find relevant continuous lines, surfaces , gamemaker, xcode or unity.

if come solution friend talking about, xcode/unity - preferably both (or if tell me talking gamemaker), i’d grateful, optimise game , reduce severe lags after around 30 seconds.

also, i’d grateful if suggest alternative solutions this, too.

i'm using gamemaker have no knowledge of xcode or unity. can't directly can explain gamemaker surfaces.

surfaces in gm objects can draw on instead of directly drawing on screen. later can draw surface screen. main advantage of can store surface , example draw again in tick, while screen redrawn in every tick, or can change on time.

surfaces bitmaps draw on. means wouldn't hard same in other environment. other libraries/apis call canvas.

in example draw 1 circle bitmap in each tick , draw whole bitmap screen.

a related topic destructible terrain discussed here: https://gamedev.stackexchange.com/questions/6721/implementing-a-2d-destructible-landscape-like-worms


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -