Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - codingHere

Pages: [1]
1
i got this goin on

for (int i = 0; i < 10; i++)
            {
                for (int j = 0; j < 10; j++)
                {
                    if (grid[j] == 2)
                    {
                        Sprite sprite;
                   

                        FloatRect Entity::dirtTexture() {
                        return sprite.GetPosition().x,
                        sprite.GetPosition().y,
                        sprite.GetSize().x,
                        sprite.GetSize().y,
                    }

                        bool Entity::Collides( *) {
                        return myRect().Intersects(e->myRect());
                        };

                       
                       if ()
                       {
                        sprite.setTexture(grassTexture);
                       }
                       else
                       {
                        sprite.setTexture(dirtTexture);
                       }
                        sprite.setPosition(i * 218, j * 216);
                        window.draw(sprite);
                    }
                }
                cout << "\n";

i dont know whats wrong can you guys help?  ??? :-\ :-\ :-\

2
Window / will this random terrain generator work?
« on: October 10, 2021, 05:51:07 am »
array (4,000) (4,000)

set each part of the array to one of the following:

rock
grass
air
dirt
water

this will make a mess.

so i will set the probability for each one at a different layer.
 :)
tell me if im wrong but this should probably work?

3
General / why does this not work i read multiple posts still doesnt work
« on: October 09, 2021, 02:42:17 am »
why does this not work???

   if (Keyboard::isKeyPressed(Keyboard::Enter))
                {
                    gameNotStarted = false;
                }
        // set the color
        text.setFillColor(Color::White);
       
        //position the text
        FloatRect textRect = text.getLocalBounds();

        text.setOrigin(textRect.width / 2.0f, textRect.top + textRect.height / 2.0f);
        text.setPosition(7200 / 3.4f, 1000 / 2.0f);

       


       


        window.clear();
        //draw here
        if (gameNotStarted = true)
        {
            window.draw(text);
        }

Pages: [1]
anything