Player sprite on top of other sprites
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
-
- Prole
- Posts: 18
- Joined: Sun May 05, 2013 11:34 pm
Player sprite on top of other sprites
I am new to this language and I can't figure out how to make my player sprite always on top of my other sprites. Currently it is under my grass sprite, and I don't know why or how to fix it. Can anyone help?
Re: Player sprite on top of other sprites
That depends on the drawing order. You have something like this:
but you need this:
Code: Select all
drawPlayer
drawGrassTile
Code: Select all
drawGrassTile
drawPlayer
Check out my blog on gamedev
-
- Prole
- Posts: 18
- Joined: Sun May 05, 2013 11:34 pm
Re: Player sprite on top of other sprites
Thank you!
- rhezalouis
- Party member
- Posts: 100
- Joined: Mon Dec 07, 2009 10:27 am
- Location: Indonesia
- Contact:
Re: Player sprite on top of other sprites
Hi thecodejunkie,
P.S. Please attach your *.love file to help other people to help you.
if you have several objects to draw and some might be in front of the other, you might want to manage the rendering order by some means.
P.S. Please attach your *.love file to help other people to help you.
if you have several objects to draw and some might be in front of the other, you might want to manage the rendering order by some means.
- Order the drawing function manually as suggested by micha.
- Or create an object manager that stores them in order as you create them.
- Or add a variable in the object, then let the object manager draw each object in the order of that variable.
- Or create table called backgroundLayer, playerLayer, foregroundLayer, then put everything you want to draw at that level in the respective table then draw them background first, then the player, then the foreground objects.
- Attachments
-
- thecodejunkie-renderingOrder2.love
- LÖVE 0.8.0
- (3.23 KiB) Downloaded 192 times
Aargh, I am wasting my posts! My citizenshiiiip...
Who is online
Users browsing this forum: No registered users and 2 guests