Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Space Shooter

The classic retro game recreated using `Pygame` and `python`.
The classic retro game recreated using `Pygame` and `Python`.

<a href="https://news.ycombinator.com/item?id=10925168"><img src="https://raw.githubusercontent.com/wingify/across-tabs/master/images/hn.png" width="150" height="20"/></a>
<a href="https://www.producthunt.com/posts/space-shooter"><img src="https://raw.githubusercontent.com/wingify/across-tabs/master/images/product_hunt.png" width="100" height="20"/></a>
Expand Down Expand Up @@ -51,7 +51,7 @@ Follow the youtube video to see how I fared on ``spaceShooter``
- Power ups like
- shield: increases the space ships life
- bolt: increases the shooting capability of the ship by firing 2 to 3 bullets instead of one at time.
- Custom sounds and sprite animation for things like
- Custom sounds and sprite animation for things like:
- meteorite explosion
- bullet shoots
- player explosion
Expand All @@ -62,7 +62,7 @@ Follow the youtube video to see how I fared on ``spaceShooter``

[[Back to top]](https://github.com/tasdikrahman/spaceShooter#index)

| | Button |
| To | Press Button |
|--------------|---------------------|
| Move Left | <kbd>left</kbd> |
| Move right | <kbd>right</kbd> |
Expand Down
20 changes: 20 additions & 0 deletions reversearray.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#include <iostream>
using namespace std;

int main(){
int x1,v1,x2,v2,p;
double n;
cin>>x1>>v1>>x2>>v2;
n=(x1-x2)/(v2-v1);
p=n;
if(n-p==0 && n>0){
cout<<"YES";}else{
cout<<"NO";
}



return 0;
}