Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Dakshdd

8
Posts
2
Topics
1
Following
A member registered Oct 28, 2020

Recent community posts

Infix Jam community · Posted in IA

Welcome to IA game

Infix Jam community · Posted in IA

Thankyou for play the game

Infix Jam community · Replied to Dakshdd in IA

welcome to IA 

Infix Jam community · Posted in IA

#define NUM_PARTICLES 1
// Two dimensional vector.
typedef struct {    float x;    float y;
} Vector2;
// Two dimensional particle.
typedef struct {    Vector2 position;    Vector2 velocity;    float mass;
} Particle;
// Global array of particles.
Particle particles[NUM_PARTICLES];
// Prints all particles' position to the output. We could instead draw them on screen
// in a more interesting application.
void  PrintParticles() {    for (int i = 0; i < NUM_PARTICLES; ++i) {        Particle *particle = &particles[i];        printf("particle[%i] (%.2f, %.2f)\n", i, particle->position.x, particle->position.y);    }
}
// Initializes all particles with random positions, zero velocities and 1kg mass.
void InitializeParticles() {    for (int i = 0; i < NUM_PARTICLES; ++i) {        particles[i].position = (Vector2){arc4random_uniform(50), arc4random_uniform(50)};        particles[i].velocity = (Vector2){0, 0};        particles[i].mass = 1;    }
}
// Just applies Earth's gravity force (mass times gravity acceleration 9.81 m/s^2) to each particle.
Vector2 ComputeForce(Particle *particle) {    return (Vector2){0, particle->mass * -9.81};
}
void RunSimulation() {    float totalSimulationTime = 10; // The simulation will run for 10 seconds.    float currentTime = 0; // This accumulates the time that has passed.    float dt = 1; // Each step will take one second.        InitializeParticles();    PrintParticles();        while (currentTime < totalSimulationTime) {        // We're sleeping here to keep things simple. In real applications you'd use some        // timing API to get the current time in milliseconds and compute dt in the beginning         // of every iteration like this:        // currentTime = GetTime()        // dt = currentTime - previousTime        // previousTime = currentTime        sleep(dt);
        for (int i = 0; i < NUM_PARTICLES; ++i) {            Particle *particle = &particles[i];            Vector2 force = ComputeForce(particle);            Vector2 acceleration = (Vector2){force.x / particle->mass, force.y / particle->mass};            particle->velocity.x += acceleration.x * dt;            particle->velocity.y += acceleration.y * dt;            particle->position.x += particle->velocity.x * dt;            particle->position.y += particle->velocity.y * dt;        }                PrintParticles();        currentTime += dt;    }
}
Infix Jam community · Posted in IA

You can post my game to others

Infix Jam community · Posted in IA

Sir can you please help me to make a pubg like game

Infix Jam community · Created a new topic IA

#define NUM_PARTICLES 1
// Two dimensional vector.
typedef struct {    float x;    float y;
} Vector2;
// Two dimensional particle.
typedef struct {    Vector2 position;    Vector2 velocity;    float mass;
} Particle;
// Global array of particles.
Particle particles[NUM_PARTICLES];
// Prints all particles' position to the output. We could instead draw them on screen
// in a more interesting application.
void  PrintParticles() {    for (int i = 0; i < NUM_PARTICLES; ++i) {        Particle *particle = &particles[i];        printf("particle[%i] (%.2f, %.2f)\n", i, particle->position.x, particle->position.y);    }
}
// Initializes all particles with random positions, zero velocities and 1kg mass.
void InitializeParticles() {    for (int i = 0; i < NUM_PARTICLES; ++i) {        particles[i].position = (Vector2){arc4random_uniform(50), arc4random_uniform(50)};        particles[i].velocity = (Vector2){0, 0};        particles[i].mass = 1;    }
}
// Just applies Earth's gravity force (mass times gravity acceleration 9.81 m/s^2) to each particle.
Vector2 ComputeForce(Particle *particle) {    return (Vector2){0, particle->mass * -9.81};
}
void RunSimulation() {    float totalSimulationTime = 10; // The simulation will run for 10 seconds.    float currentTime = 0; // This accumulates the time that has passed.    float dt = 1; // Each step will take one second.        InitializeParticles();    PrintParticles();        while (currentTime < totalSimulationTime) {        // We're sleeping here to keep things simple. In real applications you'd use some        // timing API to get the current time in milliseconds and compute dt in the beginning         // of every iteration like this:        // currentTime = GetTime()        // dt = currentTime - previousTime        // previousTime = currentTime        sleep(dt);
        for (int i = 0; i < NUM_PARTICLES; ++i) {            Particle *particle = &particles[i];            Vector2 force = ComputeForce(particle);            Vector2 acceleration = (Vector2){force.x / particle->mass, force.y / particle->mass};            particle->velocity.x += acceleration.x * dt;            particle->velocity.y += acceleration.y * dt;            particle->position.x += particle->velocity.x * dt;            particle->position.y += particle->velocity.y * dt;        }                PrintParticles();        currentTime += dt;    }
}
Infix Jam community · Created a new topic IA

#define NUM_PARTICLES 1


// Two dimensional vector.

typedef struct {

    float x;

    float y;

} Vector2;


// Two dimensional particle.

typedef struct {

    Vector2 position;

    Vector2 velocity;

    float mass;

} Particle;


// Global array of particles.

Particle particles[NUM_PARTICLES];


// Prints all particles' position to the output. We could instead draw them on screen

// in a more interesting application.

void PrintParticles() {

    for (int i = 0; i < NUM_PARTICLES; ++i) {

        Particle *particle = &particles[i];

        printf("particle[%i] (%.2f, %.2f)\n", i, particle->position.x, particle->position.y);

    }

}


// Initializes all particles with random positions, zero velocities and 1kg mass.

void InitializeParticles() {

    for (int i = 0; i < NUM_PARTICLES; ++i) {

        particles[i].position = (Vector2){arc4random_uniform(50), arc4random_uniform(50)};

        particles[i].velocity = (Vector2){0, 0};

        particles[i].mass = 1;

    }

}


// Just applies Earth's gravity force (mass times gravity acceleration 9.81 m/s^2) to each particle.

Vector2 ComputeForce(Particle *particle) {

    return (Vector2){0, particle->mass * -9.81};

}


void RunSimulation() {

    float totalSimulationTime = 10; // The simulation will run for 10 seconds.

    float currentTime = 0; // This accumulates the time that has passed.

    float dt = 1; // Each step will take one second.

    

    InitializeParticles();

    PrintParticles();

    

    while (currentTime < totalSimulationTime) {

        // We're sleeping here to keep things simple. In real applications you'd use some

        // timing API to get the current time in milliseconds and compute dt in the beginning 

        // of every iteration like this:

        // currentTime = GetTime()

        // dt = currentTime - previousTime

        // previousTime = currentTime

        sleep(dt);


        for (int i = 0; i < NUM_PARTICLES; ++i) {

            Particle *particle = &particles[i];

            Vector2 force = ComputeForce(particle);

            Vector2 acceleration = (Vector2){force.x / particle->mass, force.y / particle->mass};

            particle->velocity.x += acceleration.x * dt;

            particle->velocity.y += acceleration.y * dt;

            particle->position.x += particle->velocity.x * dt;

            particle->position.y += particle->velocity.y * dt;

        }

        

        PrintParticles();

        currentTime += dt;

    }

}