Sweet!

This is a discussion on Sweet! within the Game Programming forums, part of the General Programming Boards category; I'm sorry, I just must express my joy in writing a function that would normally take lots of attempts and ...

  1. #1
    Unregistered Leeman_s's Avatar
    Join Date
    Oct 2001
    Posts
    753

    Sweet!

    I'm sorry, I just must express my joy in writing a function that would normally take lots of attempts and debugging to get right, but it works now! First compile and run after switching up my whole pong program and it works!

    here it is (please don't laugh because it would be real simple for you to do )
    Code:
    void InitBlocks()
    {
    	int xcounter = 0;
    	int ycounter = 0;
    
    	BITMAP bm;
    	GetObject(blockstate1, sizeof(bm), &bm);
    
    	for(int x=0; x<=399; x++)
    	{
    		blocks[x].current_pic = &blockstate3;
    		blocks[x].health = 3;
    		blocks[x].height = bm.bmHeight;
    		blocks[x].width = bm.bmWidth;
    		if(lev1[xcounter][ycounter] == 1)
    			blocks[x].state = true;
    		else
    			blocks[x].state = false;
    		blocks[x].x = blocks[x].width * xcounter;
    		blocks[x].y = blocks[x].height * ycounter;
    
    		xcounter++;
    		if(xcounter == 20) //20 will not be processed
    		{
    			xcounter = 0;
    			ycounter++;
    		}
    	}
    }

  2. #2
    _ Munkey01's Avatar
    Join Date
    Dec 2002
    Posts
    280
    I see no reason to laugh if it works and does exactly what you want it to do you have successfully created something of use

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Short & Sweet for a beginner
    By dispatch4599 in forum C++ Programming
    Replies: 5
    Last Post: 03-02-2008, 07:33 PM
  2. Sweet Sweet Caffinee
    By Thantos in forum A Brief History of Cprogramming.com
    Replies: 18
    Last Post: 12-14-2004, 12:22 PM
  3. It's So Sweet
    By TechWins in forum A Brief History of Cprogramming.com
    Replies: 12
    Last Post: 08-24-2003, 02:19 PM
  4. Everyone look at my totally sweet spaceship
    By Shadow12345 in forum Game Programming
    Replies: 4
    Last Post: 09-30-2002, 02:27 PM
  5. Sweet For Text Rpg's
    By rkjd2 in forum C++ Programming
    Replies: 3
    Last Post: 03-16-2002, 05:44 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21