Skip to content

Instantly share code, notes, and snippets.

@trib0r3
Created January 16, 2017 13:57
Show Gist options
  • Save trib0r3/7d1accfc5a9472150a180f55366877e8 to your computer and use it in GitHub Desktop.
Save trib0r3/7d1accfc5a9472150a180f55366877e8 to your computer and use it in GitHub Desktop.
Demo
/*
Source: http://szymonsiarkiewicz.pl/poradniki/goto/kolizje/kolizje-w-grach-2d/
Author: Szymon "shead" Siarkiewicz
*/
/* commandline:
$ g++ --version
g++ (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ g++ test.cc -o test
$ ./test
$ echo $?
3
*/
class Vector2
{
public:
int x;
int y;
};
class Box
{
public:
Vector2 position; // pozycja (x,y) krawędzi prostokąta/kwadratu
unsigned int width; // szerokość
unsigned int height; // wysokość
};
int main()
{
Box box;
box.position.x = 3;
return box.position.x;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment