C++ Progress ish
Re: C++ Progress ish
Oh I saw that game on chilis update.
Looks dope! Well done
Looks dope! Well done
Re: C++ Progress ish
Definitely search and research and find algorithms. Don't reinvent the wheel; it takes a lot of time and the results aren't gonna beat what humanity has already produced. You can learn some skills by implementing stuff like that from scratch, but researching and implementing existing algorithms is also a super important (probably more important) skill that needs to be exercised early and often. And also you wanna get shit done.ceofil wrote:What's the best way to aproch this kind of stuff? Try to do it on your own ( and probably spend a lot of time on it) or search and use a method that is already tested and it's more efficient and all?
Chili
Re: C++ Progress ish
Where I'm at so far.
This is like a demo or something. Just added a bunch of enemies and some wall for a "playable" level.
I plan on adding a level editor like in the tanks game but now it will be saving and loading levels from files. Also change the AI to be a little more responsive for what's happening around. Probably change the graphics too.
This is like a demo or something. Just added a bunch of enemies and some wall for a "playable" level.
I plan on adding a level editor like in the tanks game but now it will be saving and loading levels from files. Also change the AI to be a little more responsive for what's happening around. Probably change the graphics too.
- Attachments
-
- super hotline miami.rar
- wasd to move, left click to shoot, slow motion if you don't move, r to restart
- (2.34 MiB) Downloaded 273 times
Re: C++ Progress ish
Hi there!
Finished the level editor...kind of. Still have to figure out why when loading the level all the angles are set to 0. Also want to make it so you can load and save multiple levels and change the interface so it fits more levels.
There is already a level in there. load -> level editor -> implement to play it.
screenshot
github
Any feedback is appreciated.
Finished the level editor...kind of. Still have to figure out why when loading the level all the angles are set to 0. Also want to make it so you can load and save multiple levels and change the interface so it fits more levels.
There is already a level in there. load -> level editor -> implement to play it.
screenshot
github
Any feedback is appreciated.
- Attachments
-
- super hot.rar
- (2.94 MiB) Downloaded 246 times
Re: C++ Progress ish
Just a quick question, how far into the tutorials are you? That seems like some advanced stuff, and I'd like to help you with this , so wanted to know if I could.
Re: C++ Progress ish
The last tutorial I've watched is Intermediate 4.
-
- Posts: 4373
- Joined: February 28th, 2013, 3:23 am
- Location: Oklahoma, United States
Re: C++ Progress ish
Did you know?
instead of the slow length <= radius
You can check for LengthSq <= radiusSq
This avoids having to do the square root each iteration of the loop.
instead of the slow length <= radius
Code: Select all
for (int i = 0; i < nOtherBullets; i++)
{
if (otherBullets[i].IsSpawned())
{
if (Vec2(otherBullets[i].GetPosition() - pos).GetLength() <= radius )
{
alive = false;
otherBullets[i].Destroy();
}
}
}
Code: Select all
// Calculate square radius outside of loop to avoid recalculating each iteration.
const auto radiusSq = radius * radius;
for (int i = 0; i < nOtherBullets; i++)
{
if (otherBullets[i].IsSpawned())
{
if (Vec2(otherBullets[i].GetPosition() - pos).GetLengthSq() <= radiusSq )
{
alive = false;
otherBullets[i].Destroy();
}
}
}
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com
-
- Posts: 4373
- Joined: February 28th, 2013, 3:23 am
- Location: Oklahoma, United States
Re: C++ Progress ish
Instead of using hex codes for char keys, I would suggest using the literals; 'W', 'S', 'A', 'D'. The reason being it is way easier to tell at a glance those are the keys you are meant to push.
This way, you or anyone else won't have to look up char codes to know which letter/number/symbol you are trying to use. If I got the order wrong or incorrect keys here, it's because I didn't want to look the hex codes up.
I like the code layout, it's pretty clean, keep up the good work.
Code: Select all
if (kbd.KeyIsPressed('W'))
{
delta.y = -1.0f;
movementHappened = true;
}
else if (kbd.KeyIsPressed('S'))
{
delta.y = 1.0f;
movementHappened = true;
}
if (kbd.KeyIsPressed('A'))
{
delta.x = -1.0f;
movementHappened = true;
}
else if (kbd.KeyIsPressed('D'))
{
delta.x = 1.0f;
movementHappened = true;
}
I like the code layout, it's pretty clean, keep up the good work.
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com
Re: C++ Progress ish
Well, well, well...
What happened in the past few weeks? Not that much...at least for me.
Changed the level selection menu in the super hotline miami game.
Edit: found these http://imgur.com/a/G8eJu
Watched the old B19 tutorial for loading sprites but then I watched a few more. Nothing much, just tryna make it work. Added a little something something. Functions to make a sprite black&whie, threshhold, invert...just for fun. Maybe I'll use them later when a character dies draw him black and white, or when it takes damage draw it with threshhold.
And then do that for every pixel in the surface except the key.
Then continued with the old series ( B19 - I6 ). Great stuff. I4 was a very good watch even tho I might not have understood everything, it gives a pretty good idea about how things works.
Made the chaos game. It's still a very simple version of it with hard coded numbers and the points can't be moved.
Homework for current I6.
Good times, good times.
What happened in the past few weeks? Not that much...at least for me.
Changed the level selection menu in the super hotline miami game.
Edit: found these http://imgur.com/a/G8eJu
Watched the old B19 tutorial for loading sprites but then I watched a few more. Nothing much, just tryna make it work. Added a little something something. Functions to make a sprite black&whie, threshhold, invert...just for fun. Maybe I'll use them later when a character dies draw him black and white, or when it takes damage draw it with threshhold.
Spoiler:
Then continued with the old series ( B19 - I6 ). Great stuff. I4 was a very good watch even tho I might not have understood everything, it gives a pretty good idea about how things works.
Made the chaos game. It's still a very simple version of it with hard coded numbers and the points can't be moved.
Spoiler:
Good times, good times.