Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Ken's Artillery 2
#18
"Yeah I tried hard to make it that way again but with the new click bars I can't figure it out. It might have something to do with doing extra calculations later on or something, I don't know."

Ken, If you make a sub for drawing velocity bar and feed it an x value, you can update the velocity bar with either the current mouse of the last mx value saved in a shared variable when it's players turn.

oldVelocityX = 61 'for starters until player clicks something

sub drawVelocityBar(x) ' x is mouse x
Line (61, 41)-(259, 69), _RGB32(156, 210, 237), BF
Line (61, 41)-(x, 69), _RGB32(255, 0, 1), BF
end sub

drawVelocityBar oldVelocityX ' when start player again

drawVelocityBar mx ' when he clicks it
oldVelocityX = mx when you change the bar


do likewise for the angle bar


Comment: man you change velocity so many times I don't know if I am coming or going
This is why your code keeps changing the velocity back, at player turn start
vel = 40
vel3 = 100 ' do you even use this?

then later this:
If vel < 0 Then vel = 0 ' << fine no problem there
If vel > 80 Then vel = 80 ' OK we could go 0 to 80 directly on click bar not to 100 then this line not needed
vel = Int(vel / 4) ' this is real stumper you want a max velocity of 20??? we could go 0 to 20 on click bar and skip all this changing around stuff


So what velocity range do you want to throw the ball at? It's no problem changing the click bar to that
vel = (mx - 60) / 200 * 100 ' <<< just change the 100 to the max velocity you want to throw the ball at
and throw out 5 lines messing with velocity
b = b + ...
Reply


Messages In This Thread
Ken's Artillery 2 - by SierraKen - 04-30-2022, 11:46 PM
RE: Ken's Artillery 2 - by bplus - 05-01-2022, 12:04 AM
RE: Ken's Artillery 2 - by SierraKen - 05-01-2022, 01:41 AM
RE: Ken's Artillery 2 - by bplus - 05-01-2022, 02:30 AM
RE: Ken's Artillery 2 - by OldMoses - 05-01-2022, 03:12 AM
RE: Ken's Artillery 2 - by Dav - 05-01-2022, 03:31 AM
RE: Ken's Artillery 2 - by johnno56 - 05-01-2022, 09:27 AM
RE: Ken's Artillery 2 - by SierraKen - 05-01-2022, 03:48 PM
RE: Ken's Artillery 2 - by SierraKen - 05-01-2022, 03:51 PM
RE: Ken's Artillery 2 - by SierraKen - 05-01-2022, 04:34 PM
RE: Ken's Artillery 2 - by SierraKen - 05-02-2022, 07:16 PM
RE: Ken's Artillery 2 - by SierraKen - 05-04-2022, 01:28 AM
RE: Ken's Artillery 2 - by bplus - 05-04-2022, 01:38 AM
RE: Ken's Artillery 2 - by SierraKen - 05-04-2022, 02:51 AM
RE: Ken's Artillery 2 - by Coolman - 05-04-2022, 10:52 AM
RE: Ken's Artillery 2 - by SierraKen - 05-04-2022, 06:42 PM
RE: Ken's Artillery 2 - by OldMoses - 05-04-2022, 12:12 PM
RE: Ken's Artillery 2 - by bplus - 05-04-2022, 08:26 PM
RE: Ken's Artillery 2 - by SierraKen - 05-05-2022, 12:22 AM
RE: Ken's Artillery 2 - by SierraKen - 05-05-2022, 09:33 PM
RE: Ken's Artillery 2 - by SierraKen - 05-05-2022, 09:53 PM



Users browsing this thread: 1 Guest(s)