プレイ日記
Josiah Spike4
Finally, yes, this game has health bars and enemies!
9そうだね
プレイ済み
返信[1]
親投稿
*J.P.* DEV NEWPICY3
just a question, ive been working on my enemy ai, how did you make the hp bar follow the sprite? is it a sprite or a seperate hp bar?
0そうだね
未プレイ
返信[2]
親投稿
Josiah Spike4
It's very complicated but I'll try to explane. Each enemy has a x and y position in the world, I use these positions to place the enemy and hp bar in the world by subtracting the players x and y value. (or I should say the worlds x and y because your players sprite doesn't move but the world itself does). By obtaining this position and offsetting it with the players, I can accumulate an area for..
0そうだね
プレイ済み
返信[3]
親投稿
Josiah Spike4
...both the sprite and Hp bar in the open world wherever he and it may be :D It's a wonderful equation that works out perfectly. I hope this helps! And please comment if you have any other questions.
1そうだね
プレイ済み
返信[4]
親投稿
*J.P.* DEV NEWPICY3
ok i understand that. you dont have to really answer this but,.. your world has collision right? because mine is the same type of movement (player in middle-ish of screen) and the map moves, but ive been trying to get it to work since- well for a long time, can you explain or show me a bit of code for it? just anything..? unless your game dosent use this
0そうだね
未プレイ
返信[5]
親投稿
Josiah Spike4
Well for the borders I just put a limit on the x and y axis and for trees and other sprites I used this code in the pic :D
0そうだね
プレイ済み
返信[6]
親投稿
*J.P.* DEV NEWPICY3
so are the trees sprites or are they part of the BG? i was thinking (for mine) that i could put 1 hole BG layer with just one type of tile then put over it in another layer, that way i can make it so it stops the sprite from going through it when touching that one tile. instead of making a lot of different ones. idk..
0そうだね
未プレイ
返信[7]
親投稿
Josiah Spike4
I too had the bg layer collision idea, but there is no command like that, a bg tile collision can be approximated but it doesn't work very well. My trees and objects that are interactible in the world are all sprites. I find this works the best especially for a bg moving world :)
1そうだね
プレイ済み
返信[8]
親投稿
*J.P.* DEV NEWPICY3
ok well I got my collision up and running, I got jumping and gravity working, I got my TPAD working, so now im moving into spcol, haven't had much luck on it, I heard it was pretty easy though..?
1そうだね
未プレイ