Hey freinds how are you all i hope you all are fine and having an amazing day. Today i want to share my game development struggle with you. i have faced alot of trouble while developing the game and i still manage to make a simple step of game development because i,m newbie in development.
I tried visual studio for development and it is very amazing and reliable for game development and mostly developer recommend visual studio for development.
source : own image
#include "MainWindow.h"
#include "Game.h"
Game::Game( MainWindow& wnd )
:
wnd( wnd ),
gfx( wnd )
{
}
void Game::Go()
{
gfx.BeginFrame();
UpdateModel();
ComposeFrame();
gfx.EndFrame();
}
void Game::UpdateModel()
{
}
void Game::ComposeFrame()
{
int x, y;
x = 480;
y = 480;
int color = 600;
if (wnd.kbd.KeyIsPressed(VK_CONTROL)) {
color = 100;
}
if (wnd.kbd.KeyIsPressed(VK_SHIFT)) {
if (wnd.kbd.KeyIsPressed(VK_UP)) {
x = x - 80;
y = y - 400;
}
if (wnd.kbd.KeyIsPressed(VK_DOWN)) {
x = x - 80;
y = y + 150;
}
if (wnd.kbd.KeyIsPressed(VK_LEFT)) {
x = x - 300;
y = y - 80;
}
if (wnd.kbd.KeyIsPressed(VK_RIGHT)) {
x = x + 180;
y = y - 80;
}
gfx.PutPixel(x, y, color, 500, 0);
gfx.PutPixel(x + 1, y,color, 500, 0);
gfx.PutPixel(x + 2, y,color, 500, 0);
gfx.PutPixel(x + 3, y,color, 500, 0);
gfx.PutPixel(x, y + 1,color, 500, 0);
gfx.PutPixel(x, y + 2,color, 500, 0);
gfx.PutPixel(x, y + 3,color, 500, 0);
gfx.PutPixel(x, y, color, 500, 0);
gfx.PutPixel(x + 1, y + 1, color, 500, 0);
gfx.PutPixel(x + 2, y + 2, color, 500, 0);
gfx.PutPixel(x + 3, y + 3, color, 500, 0);
gfx.PutPixel(x + 4, y + 4, color, 500, 0);
gfx.PutPixel(x + 4, y + 1, color, 500, 0);
gfx.PutPixel(x + 3, y + 2, color, 500, 0);
gfx.PutPixel(x + 2, y + 3, color, 500, 0);
}else {
x = 480;
y = 480;
if (wnd.kbd.KeyIsPressed(VK_UP)) {
x = x - 80;
y = y - 400;
}
if (wnd.kbd.KeyIsPressed(VK_DOWN)) {
x = x - 80;
y = y + 150;
}
if (wnd.kbd.KeyIsPressed(VK_LEFT)) {
x = x - 200;
y = y - 80;
}
if (wnd.kbd.KeyIsPressed(VK_RIGHT)) {
x = x + 100;
y = y - 80;
}
gfx.PutPixel(x, y, 400, 0, color);
gfx.PutPixel(x + 1, y, 400, 0, color);
gfx.PutPixel(x + 2, y, 400, 0, color);
x = x + 8;
gfx.PutPixel(x, y, 0, 400, color);
gfx.PutPixel(x + 1, y, 400, 0, color);
gfx.PutPixel(x + 2, y, 400, 0, color);
y = y - 5;
x = x - 3;
gfx.PutPixel(x, y, 400, 0, color);
gfx.PutPixel(x, y + 1, 400, 0, color);
gfx.PutPixel(x, y + 2, 400, 0, color);
y = y + 8;
gfx.PutPixel(x, y, 0, 400, color);
gfx.PutPixel(x, y + 1, 400, 0, color);
gfx.PutPixel(x, y + 2, 400, 0, color);
}
};
amazing post
sure it is
keep learning and u can achieve success
yep
yea... we all can
yes
Posting ini menarik.. sudah kami upvote yah.. *-)
Great post
great post
i want to love coding and develop my own app
I see thats good
thanks!
good
amazing
interesting post....