Background layers
-
I think I'll have to take a look at the code to help properly. Are you using a collide function like the one in the Kenney example? You could perhaps modify it to ignore specific tiles. If you want a layered effect where a series of tiles are drawn over the player, you could create a duplicate level array. This one wouldn't be checked against in the collision function and if you used a separate
drawSheet()
for loop to draw the tiles from the duplicate array, after thedrawSheet()
for the player, you'll get the layered effect. -
Duplicate level array sounds spot on, could I just copy the existing one in the same fashion
-
Yep! Exactly :) Just make sure to use the updated name in the second for loop for drawing it!
-
Just uploaded this as a sample on the switch got my enemy's and items could to with making my character and enemy's larger tho
-
@waldron said in Background layers:
Just uploaded this as a sample on the switch got my enemy's and items could to with making my character and enemy's larger tho
Excuse my sons narration lol thinks he's a you tuber
-
@waldron wish I could upvote that more than once. Boom! There it is. Legend! Really original creation you've got there, the animations are great, thanks for sharing!
Can't believe how good this is!
-
@Dave so iv copied the array
level = [
[ 0, 0, 0, 0, 0, 0, 0 ]
]
like so what, where would i update it lol
also thanks so much for helping -
Make sure to name it something different, like level_foreground or something. Then, add to it any tiles you want to draw over the player, the same way you've added tiles to the original to create the platforms etc. in the positions you want.
Select and copy the for loop which draws the original level, then paste it after you draw the player. Update all the references to the original name with the duplicate name and Bob should, in fact, be your uncle.
-
@Dave il give it a blast .... just copying my code 10 times before messing haha
-
@Dave still not happening, i get what you mean but not working
-
I'm sure we'll get it working. Will take a look at the code tomorrow!
-
@Dave got it working;) but got game slow down but its working
-
@waldron said in Background layers:
@Dave got it working;) but got game slow down but its working
Nevermind increased my frame rate