This tutorial was awesome. I can't wait til you make more. I've looked all over for a 2D camera tutorial like this. This saved a lot of frustration. Like in some other comments, collision detection for objects that are not rectangles would be neat. Thanks so much!
First I tried to implement it to my project and couldn't figure it out, now after two days of meditating, It happened and works like a charm! Thank you! :)
And I almost forget. There are a lot of people who make videos about programming, but then they suddenly stop responding to comments, stop recording more videos and then people dont know what to do if they followed it. So I hope you won't stop doing tutorials like that because they're very helpful. =)
Hi, your tutorials are very helpful for me. I know its your last video until after Christmas. But after that can you make some tutorials about how to use this scrolling background more in-game. I mean placing objects which I can collide with, then scrolling it. You know I just mean if you can make some tutorials how to make complete playable level like in Mario. It will be very helpful, thanks.
Im making a top down shooter also, and i used the code, but my set up is different. I have the camera class, Game1 class but also a Soldier class. I draw the soldier in the Soldier class, and for some reason it doesnt let me use SpriteBatch.Begin(); in my soldier class, and also in my Game1 class that BlendState doesnt even show up on my list. Could u please help?
@oyyou91 no, no sorry i didnt elaborate more, i had already done what you told me to do, before i even got the message. I've been working with references for a while now. Lol Im just having trouble drawing the camera on screen. I dont know where to put it in the Game1 class. And also i dont have the "BlendState" like it doesnt even pop up or even exist. And also, im using XNA 3.1 not 4.0. im using this version because of my class. If you know of any other way to draw it please tell me. Thanks!
@oyyou91 okay thank you very much, its just been pissing me off haha ive tried looking on google but i havent found too much that really helps. Ill send u my draw code if u want me too
Comment removed
eihnos 1 day ago
This has been flagged as spam show
I fucking love you. Been trying to do this in my uni coursework thank you!
stevoboarder 2 days ago
This has been flagged as spam show
I fucking love you. Been trying to do this in my uni coursework thank you!
stevoboarder 2 days ago
I fucking love you. Been trying to do this in my uni coursework thank you!
stevoboarder 2 days ago
How do I make the camera stop moving beyond the edges of my level?
Can you make a tutorial?
00xXTomXx00 6 days ago in playlist Uploaded videos
Comment removed
00xXTomXx00 6 days ago in playlist Uploaded videos
@oyyou91 Could you send me the source?
Cence99 1 week ago
Christmas is over, that means vids r comming soon, i cant wait :D
ObsidianLizard 1 month ago in playlist Uploaded videos
Can´t wait for the rest of your vids :)
Guitar5830 2 months ago
Thank you, thank you, thank you! Best tutorial on 2D-camera so far.
TheDoctorofGood 2 months ago
This tutorial was awesome. I can't wait til you make more. I've looked all over for a 2D camera tutorial like this. This saved a lot of frustration. Like in some other comments, collision detection for objects that are not rectangles would be neat. Thanks so much!
jbenni6 2 months ago in playlist Uploaded videos
First I tried to implement it to my project and couldn't figure it out, now after two days of meditating, It happened and works like a charm! Thank you! :)
specialisthun 2 months ago
this is a really good and simple tutorial. Good job
knorbi19 3 months ago
Great tutorial! I would like to ask you if you could make a tutorial about per pixel collisions ?
WDWillem16 3 months ago
And I almost forget. There are a lot of people who make videos about programming, but then they suddenly stop responding to comments, stop recording more videos and then people dont know what to do if they followed it. So I hope you won't stop doing tutorials like that because they're very helpful. =)
MelbowPlay 3 months ago in playlist Więcej filmów od użytkownika oyyou91
@MelbowPlay I am staying and will keep trying to help with comments :3
And what you said in your previous comment is what I will be returning with.
oyyou91 3 months ago
Hi, your tutorials are very helpful for me. I know its your last video until after Christmas. But after that can you make some tutorials about how to use this scrolling background more in-game. I mean placing objects which I can collide with, then scrolling it. You know I just mean if you can make some tutorials how to make complete playable level like in Mario. It will be very helpful, thanks.
MelbowPlay 3 months ago in playlist Więcej filmów od użytkownika oyyou91
Im making a top down shooter also, and i used the code, but my set up is different. I have the camera class, Game1 class but also a Soldier class. I draw the soldier in the Soldier class, and for some reason it doesnt let me use SpriteBatch.Begin(); in my soldier class, and also in my Game1 class that BlendState doesnt even show up on my list. Could u please help?
Armadillopants92 3 months ago
@Armadillopants92 Okay so go to your camera class and make this change on your update method
public void Update(GameTime gameTime, Soldier soldier)
{
centre = new Vector2(soldier.spritePosition.X + (soldier.spriteRectangle.Width / 2) - 400, 0);
transform = Matrix.CreateScale(new Vector3(1,1,0)) * Matrix.CreateTranslation(new Vector3(-centre.X,-centre.Y,0));
}
You will also need to make your soldier position and rectangle public.
*See next comment*
oyyou91 3 months ago
@Armadillopants92 Next you need to make the adjustment in your Game1 class.
Find
camera.Update(gameTime, this);
and replace it with
camera.Update(gameTime, soldier);
You don't need to do SpriteBatch.Begin(); and .End; in the soldier class, only in the Game1 class.
I hope this makes sense to you.
oyyou91 3 months ago
@oyyou91 no, no sorry i didnt elaborate more, i had already done what you told me to do, before i even got the message. I've been working with references for a while now. Lol Im just having trouble drawing the camera on screen. I dont know where to put it in the Game1 class. And also i dont have the "BlendState" like it doesnt even pop up or even exist. And also, im using XNA 3.1 not 4.0. im using this version because of my class. If you know of any other way to draw it please tell me. Thanks!
Armadillopants92 3 months ago
@Armadillopants92 Okay you're right, there is no BlendState is 3.1
I'll do a bit of research and message you if I find out.
oyyou91 3 months ago
@oyyou91 okay thank you very much, its just been pissing me off haha ive tried looking on google but i havent found too much that really helps. Ill send u my draw code if u want me too
Armadillopants92 3 months ago
@Armadillopants92 Yeah I'll have a look at that.
oyyou91 3 months ago
Comment removed
kstdahora 4 months ago
@kstdahora I actually have no idea what you're talking about. I'm sorry.
oyyou91 4 months ago
In the update method of Camera, i not send Game1, my object is "nav"...that have the follow code:
public void update(GameTime gameTime, Nav nav) { centre = new Vector2(nav.Position.X + (nav.Texture.Width / 2) -400, 0); transform = Matrix.CreateScale(new Vector3(1, 1, 0)) * Matrix.CreateTranslation(new Vector3(-centre.X, -centre.Y, 0)); }
it's ok yeah?
kstdahora 4 months ago
My back ground image are not moving;;;; the code is the same :/
kstdahora 4 months ago
@kstdahora I couldn't say why without seeing your code.
oyyou91 4 months ago
This came right on time! I'm working on a school project and hadn't a clue how to make this work! Great job!
herbie004 4 months ago
GOOD JOB!
Patrickpw291 4 months ago
ooooo man you mean i have to wait like forever for more of your great tutorials??? ;(
great tutorial by the way, helped me out alot. i look forward to seeing more vids from you.
LILOEVERYTHING 4 months ago in playlist More videos from oyyou91