https://github.com/hartikainen/formulagame
Formulagame built for a Aalto University's programming course
https://github.com/hartikainen/formulagame
Last synced: about 2 months ago
JSON representation
Formulagame built for a Aalto University's programming course
- Host: GitHub
- URL: https://github.com/hartikainen/formulagame
- Owner: hartikainen
- Created: 2013-03-05T08:53:38.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2013-03-05T09:28:15.000Z (about 12 years ago)
- Last Synced: 2025-02-09T12:17:19.859Z (3 months ago)
- Language: Python
- Homepage:
- Size: 113 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Formulagame
===========A simple turn-based formula game, created with Python and PyQt4 for a programming course in Aalto University.
The rules are as follows:
MOVING:
Cars have 5 gears. The speed and the turn radius depends on the gear.
- On every turn, the player can change the gear one step up or down.
- Also, the car can be turned by one step per turn.
- When changing the gear, the direction of the car is the one that's closer
to the last turn's direction. This is calculated by using arcsin of both moves
and comparing them to each other.The move options for all five geas have been presented below:
(1) (2) (3) (4) (5)
***********
********* * *
******* * * * *
***** * * * * * *
*** * * * * * * * *
*A* * A * * A * * A * * A *
*** * * * * * * * *
***** * * * * * *
******* * * * *
********* * *
***********For example, a car driving on gear 2, the car would turn 90 degrees like this:
0.1.
.2
.
3
..
4
.
5Example 2, a car moving on gear 1 and turning 90 degrees:
01
2
3Example 3, a car changing gear up between the moves and turning at the same time:
01.
.2
..
3
..
..
4
.
.
.
5GENERAL:
The players move their cars one by one, based on the moving rules described above.
- Both cars start the race by facing right.
- If a player drives out of the road, the game ends and he loses. The player has to stay
on the road, on every point between the initial point and the end point. This is checked by using
Bresenham's algorithm.
- Two cars cannot be on the same point at the same time. If the player hits the opponent, he loses.
- The winner is the player, who drives over the finish line first.