stardance has been extended another month! the new deadline is october 31 :)

You are browsing as a guest. Sign up (or log in) to start making projects!

Basic2DP

  • 16 Devlogs
  • 35 Total hours

Basic2DP (Basic 2 Dimensional Physics) is a 2D physics engine that will feature translation of the bodies.
It is made in C++17 and SFML library is used for displaying the graphics.

Ship #1

I made a 2D physics engine which I named as Basic2DP (Basic 2 dimensional physics). It was made in C++ and uses SFML library for drawing the graphics.
As for me he most challenging part was learning the actual math and physics to apply in the program. other than this the difficult part was keeping a track of code I often forget what I am supposed to do at what places :P.
I am really proud of the fact that it is maybe the first project I have ever made that is this big I even had really fun in making it specially the theme feature was the most fun to work it for some reason, definitely enjoyed it and definitely learned a lot.
If you are going to use this project then u can get it from the release section of my github repo but make sure to have 64bit windows and do not remove any of the dll files.
Well thats all hope ya like this project :D

  • 16 devlogs
  • 35h
  • 8.47x multiplier
  • 293 Stardust
Try project → See source code →
Open comments for this post

1h 55m 46s logged

IT IS FINALLY DONE AAAAAGHHHHHHHH
I AM READY TO SHIP THE PROJECT
before that lets see what else I did all this time.
I made the readme and made minor changes to the code to improve the program like adding a ‘help’ command to get quick help
Also to get a proper guide on how things work I added a readme.html in folder of executable so the terminal doesnt feel very cluttered

0
0
22
Open comments for this post

3h 51m 56s logged

sooooo i did a lot of things
i completed the input method by taking information by getline() and parsing it and storing each infomation in a vector then it is decided what should be done by checking what is in vector at 0 index
i also finished the option for themes and i also added some premade theme to have something to work it and u can even add you own themes.
uhhhhh what else did i do….
yes decoration
the terminal by default has white text and quickly it starts looking terrible and messy so what i did was i gave the text some colour now it is a bit more cleaner to navigate between different portions in terminal.
i am gonna work on making the app capable of being exported and also add some small things here n there also yea the readme as well

0
1
45
Open comments for this post

2h 47m 43s logged

Hmmmmmmmmmmm I did a lot of work today
and my code looks very messy now and I am not even sure if it is messy or if it is supposed to look like this :crying:
Well today I completed the CLI for my physics engine and even added themes so u can customize can look.
Damn I thought I did a lot of work and now I cant even remember a single thing that I did :pepe-hmm:
Well I do know what I will be doing now
I will add a way to save the theme in device at a specific folder this way if u make any theme and close the theme u will still be able to access the previously made theme and u wont have to make it again
After that I will give it finishing touches and then README and then make a static version of this app then import then ship 🚢

0
1
111
Open comments for this post

1h 41m 31s logged

I am working on CLI system for giving input to the app
As of now I have added a couple of features like updatevelocity, applyforce, setgravity and exit
I did not do a commit yet I will do it in the next session
I will add more features into it and I currently I am adding a way to get some information from the app which I will tell about in the next devlog

0
0
23
Open comments for this post

3h 14m 18s logged

AAAAAGHHHHHHHHHHH MY HANDDD
all i did was some exercise and since then my hand hurts very bad which is why I can type properly
just a bit of weird movement and it feels like its going to fall off
soo i am gonna tell whatever I have done till now
I am done with the physics and collision and now I need to make a CLI for user to do things
For that at first I was going to pause the physics and then let the user enter but then I found out about threads
Basically when we code everything happens in a straight manner like one step at a time, imagine this like a single assembly line for producing things.
Now that I use thread I can do multiple tasks without having to stop the other task which is why I wont have to stop the physics process this is like having two assembly lines (i am not sure what that analogy means but I dont have a proper example :bleh: , basically I can do things alongside other things without having to pause)
Noww next devlog when I add something new and my hand gets better
cya!!!

0
1
102
Open comments for this post

5h 30m 29s logged

Dayum today’s time is kinda long cuz i was being a dumdum
What happened was since in a physics system we have the graphics, collision and physics so I thought of making different classes which was not a good choice so I spent a REALLLLLLLLYYYYYYYYYYYYYYY long time making those classes and since I wanted it to be inherited the system got really messy and I just kept getting error and errors.
So, I stopped and now I am no longer fighting for my life.
But then I spent some time making the wall collision a bit better, I improved the logic and also the way positioning happens in it and now the collision is extremely smooth and good looking and it no longer overlaps.
After that worked I added gravity which was simple unless you are like me who spent a lot of time but the solution was just one line away.
I just had to decrease velocity as per gravity * dt because gravity is second derivative but I kinda tried to mix things and update the velocity and position as the same time.
I also added a reference to delta time in main class this way the delta time stays consistent
Now I am gonna add a position correction system for object to object collision and then I will be more than 60% done with my project (or so I hope)

0
1
58
Open comments for this post

2h 39m 26s logged

Soo the COLLISION SYSTEM IS COMPLETE
I can finally start working on the physics it could be easy I think.
As for collision I followed this document: collision reponse

Oh wait I need to add collision response for boxes as well
I JUST REMMEBERED THIS AS I WAS WRITING THIS DEVLOG :cryign:
I am more cooked than the food when I cook it

0
0
22
Open comments for this post

1h 18m 18s logged

the collision system
i am starting to understand it now
well i cant really explain much in this session sooo i will explain everything in one go after this is done

0
0
13
Open comments for this post

50m 54s logged

for some reason i have been using things that need x and y components as different variables which i dont know why i was doing so i shrinked(if thats a word) them and joined everything info sf::vector2f
other than that i spent the time trying to implement things that i did not properly understood
gonna spend some time studying a bit better

0
0
13
Open comments for this post

38m 59s logged

well didnt do much today got busy here n there
today i finally implemented the functions and classes and they are working smoothly rn, at first i did run into some weird errors which i fixed
now i am gonna work on adding object to object collision now that i am done with the regular collision.

0
0
4
Open comments for this post

1h 29m 53s logged

I added header files and seperated things to make them cleaner to look at
i havent updated the code to work with the headers they are seperate now but I will change it later
uhh i forgot what else i had done cuz my hackatime was not working

0
1
144
Open comments for this post

1h 28m 45s logged

MY EXAMS ARE OVERRRRRRRR
and now im back on work and I will try to do a devlog almost everyday.
I have been working on making the collision system for now i worked with the borders each time I will run into some problem like velocity being updated each frame time after it collides or getting garbage values because I forgot to initialize the variables.
Now they are fixed and now I will work on implementing collsion with other physics objects and before that I noticed that the circle will sometimes do slightly behind the border which is what I will fix.

0
0
15
Open comments for this post

3h 17m 55s logged

Soo the last time I wrote the code everything was messy and since I had done not so much work I thought of doing everything from the beginning.
So I did and this also helped me to understand and improve everything by making the code a bit cleaner and making some functions and classes
I also made a struct vector for storing information of the entities.
For now I am working on adding only when the objects are circles also since I am implementing only the translation for now thats why I dont think someone will be bothered by not having rotation cuz they probably wont notice any.

0
0
2
Open comments for this post

59m 30s logged

I couldnt do much today my exams are going on.
But I made some changes to the coordinate system before this the +Y was going downwards now it is upwards
Now I have a better grid system such that every coordinate is positive and I wont have to deal with negative numbers

0
0
8
Open comments for this post

1h 18m 40s logged

Soo I realised that making new shapes gets kinda lengthy sometimes so I added a class an object that will help me make a new shape
Also before I make anything related to translation and collision I will have to design the grid system
I am still thinking of how I should implement the grid and where I should keep the origin
Also I specified a fixed size of the window and including the border it is 840x640 pixels and without the border it is 800x600 pixels

0
1
8
Open comments for this post

1h 33m 43s logged

Soo I just started making things and I have never really used a graphics library before so I spent quite a lot of time learning about how I am supposed to be using this library
Things went good and it was actually pretty easy to get used to
From tomorrow I think I will probably work on implementing movement first
or collision first……we will see

0
1
153

Delete project?

Are you sure you want to permanently delete this project? This action cannot be undone.

All devlogs, followers, and associated data will be removed.

Followers

Loading…