ShadowsEdge19's Profile User Rating: *****

Reputation: 142 Stalwart
Group:
Active Members
Active Posts:
665 (0.39 per day)
Joined:
16-January 10
Profile Views:
16,930
Last Active:
User is offline Feb 05 2013 03:44 PM
Currently:
Offline

Previous Fields

Country:
GB
OS Preference:
Windows
Favorite Browser:
Chrome
Favorite Processor:
Intel
Favorite Gaming Platform:
XBox
Your Car:
Honda
Dream Kudos:
0

Latest Visitors

Icon   ShadowsEdge19 Nothing is impossible!

Posts I've Made

  1. In Topic: Problem with collision detection with an Array

    Posted 9 Oct 2012

    I thought with space invaders each row of enemies would be moving in the opposite direction from the row above/below and would keep alternating as they descended, you might need a specific version of isRight in the EnemyData structure so each individual enemy can be coded to move in the same direction as with all the others on the same row.

    > > > > > > > > > >
    < < < < < < < < < <
    > > > > > > > > > >
    < < < < < < < < < <
    > > > > > > > > > >

    ^
  2. In Topic: XNA passing through if else statement, even though meeting if()

    Posted 9 Oct 2012

    Have you tried changing the order for your rectangle intersection logic as it seems to me that you are trying to fit the door into the key instead of the key into the door if you get my analogy.

    Since I can't see anything wrong with the IF/SWITCH logic in your playerturn() function it must be where you call it, and since you've only got it active in collisionDetect() I'd say that is where your problem lies, otherwise the only other place is where that function is called in Update().

    void collisionDetect()
            {
                for (int y = 0; y < 3; y++)
                {
                    for (int x = 0; x < 3; x++)
                    {
                        Rectangle tileRect1 = new Rectangle(x * 200, y * 200, 200, 200);
                        if (mouseRect.Intersects(tileRect1))
                        {
                            Vector2 pos = new Vector2(x * 200, y * 200);
                            playerturn(pos);
    
    
                            y = 3;
                            x = 3;
                            //    turn++; 
    
                        }
                    }
                }
    
            }
    
    


    There is another problem you will definitely encounter within your playerturn() function that I will give you a heads-up about now.
    Where you declare int x = 0; and int y = 0; inside the routine, yet you are trying to increment them inside the routine without either a loop, or you are assuming that these values are meant to be globally available, then as soon as this function is finished those values will be reset, even more so if you redeclare them at the start of the function every single time you call it.

    They will always be 0 when you run through the procedural logic and end at 1.

My Information

Member Title:
D.I.C Addict
Age:
27 years old
Birthday:
June 28, 1987
Gender:
Location:
Witney, England
Interests:
Reading fantasy and adventure novels, watching action tv shows and anime, One Piece manga, video gaming mostly on the xbox 360. I prefer RPGs and dislike sports games.
Full Name:
Adam Compton
Years Programming:
8
Programming Languages:
Have learned: Pascal, VB, C, PHP, some Java, Javascript, Haskell, Prolog and C++.
Current: C# with XNA

Contact Information

E-mail:
Private
MSN:
MSN  goldensunmaster@hotmail.com
Website URL:
Website URL  http://

Comments

Page 1 of 1
  1. Photo

    Kilorn Icon

    30 Sep 2011 - 11:52
    Congratulations on being the first person to claim the new XNA Reputation award. You've been working so hard for the XNA community around here lately, you've earned it!
  2. Photo

    gabehabe Icon

    18 Sep 2011 - 09:35
    "goldensunmaster@hotmail.com"
    That game is AWESOME.
  3. Photo

    prience123 Icon

    21 Jun 2010 - 16:39
    Good idea about progggg
Page 1 of 1