C# Xna tutorial 2: Advanced sprite drawing, rectangular collision part 2

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
4,796
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Jun 23, 2010

In this tutorial we'll be going over the better methods of drawing sprites, how to draw a background, and how to detect basic rectangular collision!

I know the audio is a little out of sync, but it's bearable..

Website:
http://zombieteam.net/blog/

I apologize if you cannot understand me heh.

  • likes, 1 dislikes

Link to this comment:

Share to:

Uploader Comments (XSkullsGames)

  • I have very little expericence programming and my goal is to be able to create an overhead view game like Zelda. Your tutorials have helped me get a few steps closer and I'd love to see you go further in that direction. What I think ShortAndSweet means by "solid collision" is the sprite not being able to walk through the other sprite. Like a wall would be in Zelda. Not sure what to write in the second half of the if(playerRect.intersects(wallR­ect)) line. Anyway thanks I'm starting to get it :)

  • @BattleToads4ever ah, ok I get it. To do that, you have several options, none of which i've perfected. you can do a simple rebound collision. if(playerRect.intersects(wallR­­ect)) { playerPos.X -= 1; } and you can add a keyboard check along with that. if(playerRect.intersects(wallR­­ect) && keyboard.getstate(PlayerIndex.­One).IsKeyDown(Keys.Left)) { playerPos.X -= 1; } etc, etc. that's not the best, but it'll get you started.
  • @XSkullsGames LOL when i tried the keyboard check method you suggested, i got the player stuck inside the wall and i couldn't move!

  • @agentEE7 LOL, that'll happen ;) I've yet to find the perfect collision formula :O

  • can you do a solid collision?

    p.s. great tutorial

  • @SuperShortAndSweet

    What exactly do you mean? Per pixel?

see all

All Comments (11)

Sign In or Sign Up now to post a comment!
  • thanks man this is awsome !! all the other vids never worked thanks!!!!

  • i need it too ..

    its like the player can pass through enemy and it cant pass out of the form boundary...

    thanks

  • @XSkullsGames

    okay, I see. Thanks I'm gonna play around with that right now...

  • wonderful thank you

Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more