Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 21
  1. #11
    Join Date
    Sep 2008
    Posts
    21
    Ah sorry, I forgot to include that portion in my post. Here it is:

    Code:
    void Level::addPlayer(Character *p)
    {
    	player = p;
    }
    
    
    bool Level::keyPress(char c)
    {
    	if(player)
    		if(player->keyPress(c))
    			return true;
    	return false;
    }
    I don't get any compilation errors or warnings which is what's throwing me off. The game will just not display any sprites, and then crash. I'm still trying to debug the code to see what it is though...it's really confusing to figure out what's wrong

    If you want to I can post all of my code from the VTM, or send it to you if that's preferable. I don't know how keen the community would be on me posting all of the code here. I'm not asking you or anyone else to do my work, I just don't understand enough about what the problem is to fix it.

  2. #12
    Join Date
    Nov 2006
    Location
    UK
    Posts
    3,774
    OK, but at no point does any of the code show you making a player - my code has a line to make a player
    Delphi !ROCKS!
    Got a question? Read this first!!!
    "You gotta help us, Doc. We've tried nothin' and we're all out of ideas"

  3. #13
    Join Date
    Sep 2008
    Posts
    21
    Code:
    player = new Character(level, &drawArea, 0);


    Thank you Liz!

    I know this is going to sound crazy, but I didn't know what the problem was at first. After reading this:

    at no point does any of the code show you making a player
    I started looking through my code, removing commented code, re-typing and testing. In a freak debug it worked haha. My bet was that the line above was commented out on accident. So, I tried commenting it out and I re-produced my bug. Going back through the VTM I wanted to see what was going through my head at the time. Was I just sleepy? At one point in the lesson, I was instructed to comment out this line:

    Code:
    player = new Sprite(&drawArea, 0);
    Which granted is not the same, but looks a little similar. I probably ended up commenting out both on accident while troubleshooting some other regular compile errors (spelling, punctuation, etc).

    Thank you for you help guys! Problem solved!

  4. #14
    Join Date
    Nov 2006
    Location
    UK
    Posts
    3,774


    <cheeky>See, told you it didnt exist </cheeky>
    glad you fixed it
    Delphi !ROCKS!
    Got a question? Read this first!!!
    "You gotta help us, Doc. We've tried nothin' and we're all out of ideas"

  5. #15
    Join Date
    Mar 2003
    Location
    Denmark
    Posts
    2,882
    Glad you fixed it too Plus you gained some extremely important knowledge and experience about debugging
    Swoop - Buzzed Pirate!
    " If nobodys talking to me, im talking to me" - Swoop

    Reflection Design || Swoops Blog

    2D Tutorials Compilation

    The Speed Painting Thread || ((post your Concept Art thread))


  6. #16
    Join Date
    May 2007
    Location
    Upstate, NY
    Posts
    504
    Hey congrats! I'm glad to see you kept your cool, and didn't throw the towel in. And nice work Liz. You're too good at helping people arrive at an answer without simply giving it to them. As a result, your helpfulness will now be restricted to an "open season" of Oct 1 - Nov 15. Heheheh, j/k.

    EDIT: "You must spread some Reputation around before giving it to LizRiley again." Doh! Apparently there's more than just a simple timer on giving rep to someone twice in a row. *shakes fist*
    Last edited by Wren Akula; 12-09-2008 at 07:37 AM.
    The spice must flow.

  7. #17
    Join Date
    Nov 2006
    Location
    UK
    Posts
    3,774
    hehe, thanks for the thought I love the idea of Liz helpfulness open season.. where I guess I could be a grumpy old trout for the rest .. Hmm would you guys really notice the difference?
    Delphi !ROCKS!
    Got a question? Read this first!!!
    "You gotta help us, Doc. We've tried nothin' and we're all out of ideas"

  8. #18
    Join Date
    Jan 2004
    Location
    Kemptville, Ontario
    Posts
    6,242
    EDIT: "You must spread some Reputation around before giving it to LizRiley again." Doh! Apparently there's more than just a simple timer on giving rep to someone twice in a row. *shakes fist*
    I gave her some rep for you.

    Folks there is a reason, several actually, why some of us are grumpy around here.
    I have figured out what the internet is. You know what they say about an infinite number of monkeys hitting keys at random on an infinite number of typewriters for an infinite amount of time? Well the internet is like that. There is some big cosmic alien running that experiment here in order to find the answer to some big question or to create the greatest piece of literature known to the universe. From what I have seen so far I am sorry to say they are going to be greatly disappointed.

  9. #19
    Join Date
    Nov 2006
    Location
    UK
    Posts
    3,774
    Awww thanks Ben..
    *hug*
    Delphi !ROCKS!
    Got a question? Read this first!!!
    "You gotta help us, Doc. We've tried nothin' and we're all out of ideas"

  10. #20
    Join Date
    Sep 2008
    Posts
    21
    I gave her some rep too. That's a cool forum feature. I wasn't even aware of it until you guys started talking about it; I thought the green bar was a "post indicator"

Page 2 of 3 FirstFirst 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •