Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Spinner Game Demo
#20
(10-04-2024, 10:04 PM)NakedApe Wrote: Also Terry I was checking out your library and noticed a Vec2Deg function that was longer than the one I use. Is this simpler version as useful?

Code: (Select All)
Dim As Single Vx, Vy, angle

start:
Cls
Print "Type in vectors, Vx, Vy"
Input Vx: Input Vy
angle = Vec2Deg(Vx, Vy)
Print: Print "The answer is "; Using "###.###"; angle;: Print " degrees."
If Vx = 0 Or Vy = 0 Then System
Sleep
GoTo start:

Function Vec2Deg (Vx As Single, Vy As Single) '
    ' ** Turns vector pairs into degrees  **
    Dim As Double radian
    Dim As Single degrees

    radian = _Atan2(Vx, Vy) '
    degrees = _R2D(radian) '
    If degrees < 0 Then degrees = 360 + degrees '
    Vec2Deg = degrees '
End Function
Yes, yours and Steve's routines are much better. Thank you for pointing that out and sharing the code.

That goes for everyone, if you notice that any of my libraries can be enhanced/improved upon by all means let me know. Many of the small libraries I post with code here make up the larger game library I'm working on. The better the routines the better the library will be.
New to QB64pe? Visit the QB64 tutorial to get started.
QB64 Tutorial
Reply


Messages In This Thread
Spinner Game Demo - by TerryRitchie - 10-03-2024, 07:53 PM
RE: Spinner Game Demo - by RokCoder - 10-03-2024, 09:32 PM
RE: Spinner Game Demo - by TerryRitchie - 10-03-2024, 09:54 PM
RE: Spinner Game Demo - by Dav - 10-03-2024, 10:12 PM
RE: Spinner Game Demo - by TerryRitchie - 10-03-2024, 10:16 PM
RE: Spinner Game Demo - by Dav - 10-03-2024, 10:22 PM
RE: Spinner Game Demo - by TerryRitchie - 10-03-2024, 10:42 PM
RE: Spinner Game Demo - by Pete - 10-04-2024, 12:52 AM
RE: Spinner Game Demo - by TerryRitchie - 10-04-2024, 03:49 AM
RE: Spinner Game Demo - by JRace - 10-04-2024, 03:54 AM
RE: Spinner Game Demo - by TerryRitchie - 10-04-2024, 02:31 PM
RE: Spinner Game Demo - by TerryRitchie - 10-04-2024, 02:40 PM
RE: Spinner Game Demo - by NakedApe - 10-04-2024, 05:48 PM
RE: Spinner Game Demo - by TerryRitchie - 10-04-2024, 06:34 PM
RE: Spinner Game Demo - by NakedApe - 10-04-2024, 06:52 PM
RE: Spinner Game Demo - by TerryRitchie - 10-04-2024, 08:34 PM
RE: Spinner Game Demo - by NakedApe - 10-04-2024, 09:13 PM
RE: Spinner Game Demo - by NakedApe - 10-04-2024, 10:04 PM
RE: Spinner Game Demo - by SMcNeill - 10-04-2024, 10:24 PM
RE: Spinner Game Demo - by TerryRitchie - 10-04-2024, 10:57 PM
RE: Spinner Game Demo - by NakedApe - 10-05-2024, 04:31 AM
RE: Spinner Game Demo - by SMcNeill - 10-05-2024, 07:59 AM
RE: Spinner Game Demo - by NakedApe - 10-05-2024, 03:08 PM



Users browsing this thread: 2 Guest(s)