about summary refs log tree commit diff stats
path: root/LICENSE
blob: 7af5b6e759ce7b946373f9859f867738932bf781 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
pre { line-height: 125%; }
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
span.linenos { color: inherit; background-color: transparent; padding-
MIT/X Consortium License

© 2006-2008 Anselm R Garbe <garbeam at gmail dot com>
© 2006-2007 Sander van Dijk <a dot h dot vandijk at gmail dot com>
© 2006-2007 Jukka Salmi <jukka at salmi dot ch>
© 2007 Premysl Hruby <dfenze at gmail dot com>
© 2007 Szabolcs Nagy <nszabolcs at gmail dot com>
© 2007 Christof Musik <christof at sendfax dot de>
© 2007-2008 Enno Gottox Boland <gottox at s01 dot de>

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the 
Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in 
all copies or substantial portions of the Software. 

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL 
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
DEALINGS IN THE SOFTWARE.
pan class="o">// indirect github.com/mattn/go-sqlite3 v1.10.0 github.com/onsi/ginkgo v1.8.0 // indirect github.com/onsi/gomega v1.5.0 // indirect github.com/pelletier/go-toml v1.4.0 // indirect github.com/spf13/afero v1.2.2 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.3 github.com/spf13/viper v1.4.0 github.com/stretchr/testify v1.3.0 // indirect github.com/syndtr/goleveldb v1.0.0 golang.org/x/net v0.0.0-20190603091049-60506f45cf65 // indirect golang.org/x/sys v0.0.0-20190602015325-4c4f7f33c9ed // indirect golang.org/x/text v0.3.2 // indirect ) span class="w"> LEFT) { Ball->Direction = RIGHT; Ball->Speed *= 1.5f; if (Ball->Speed > 40) { Ball->Speed = 40; } if (Ball->Speed != 40) { Ball->Angle = GetRandomValue(-10, 10); } else { Ball->Angle = GetRandomValue(-30, 30); } play_audio(0); } if (NoEnemy == false) { if (CheckCollisionRecs(*Enemy, Ball->HitBox) && Ball->Direction == RIGHT) { Ball->Direction = LEFT; Ball->Speed *= 1.5f; if (Ball->Speed > 40) { Ball->Speed = 40; } if (Ball->Speed != 40) { Ball->Angle = GetRandomValue(-10, 10); } else { Ball->Angle = GetRandomValue(-30, 30); } play_audio(SOUND_BOUNCE); } } // Bounce ball if touches top or bottom of screen. if ( (Ball->Y+32 >= 720 && Ball->Angle >=1) || (Ball->Y <= 0 && Ball->Angle <= -1) ) { Ball->Angle *= -1; play_audio(SOUND_BOUNCE); } // Calculates score and resets ball. bool Scored = false; if (Ball->X < 0 && NoEnemy == false) { *EnemyScore += 1; Scored = true; } else if (Ball ->X > 1280 && NoEnemy == false) { *PlayerScore += 1; Scored = true; } else if (Ball->X > (1280-32) && NoEnemy == true) { *PlayerScore += 1; Scored = false; Ball->Direction = LEFT; play_audio(SOUND_PLAYER_SCORE); } if (Scored == true) { Ball->X = 1280/2.0f; Ball->Y = 720/2.0f; Ball->Speed = 3.0f; Ball->Angle = 0; } return; }