トピック
Clayton DarkClay88

I need your help again raimondz. xP

So, I used your camera code you helped me with earlier in a new game. I had two things. 1. How do you code BG collision with the camera? 2. How do I make it so, when I enter a new area, I start at the bottom of the camera and not the top left? If you could help, then thanks! :)
6そうだね
プレイ済み
返信[1]
親投稿
raimondz raimondzz
The camera that I made before has 4 variables: position x,position y, speed x and speed y. 2. Just change the variable X and Y. Then the camera will jump to that position on the next frame. 1. This is a bit tricky but you need to check all the tiles that will be overlapped by the boundaries of the camera.
0そうだね
プレイ済み
返信[2]
親投稿
raimondz raimondzz
I don't have the code that I gave you before. If you post the key, then I can write a function to detect collision between the camera and the background.
0そうだね
プレイ済み
返信[3]
親投稿
Clayton DarkClay88
JK23NDJS When you run the game, move all the way up then you'll move to the area with your camera code. I haven't changed the camera yet. I didn't know what to change.
0そうだね
プレイ済み
返信[4]
親投稿
raimondz raimondzz
Ok, I've downloaded the key. I'll upload the changes tomorrow.
1そうだね
プレイ済み
返信[5]
親投稿
raimondz raimondzz
Ok, I manage to add limits with the camera and the player will start at the bottom of the map. I used metadata of where the map could be in the map instead of checking collision between the camera and the background because the later is slower. KEY: CE5VK3AJ
1そうだね
プレイ済み
返信[6]
親投稿
raimondz raimondzz
Also, you must avoid copy-paste. I saw that you did that for the player's actions. You should put those on a function instead. Else it'll be very tedious when you try to add new stuff for the player(Example: talk, open menu, etc).
1そうだね
プレイ済み