Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers AppGameKit Corner / What am I doing wrong with the COS() and SIN ()? Not returning correct values

Author
Message
Golelorn
8
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 12th Apr 2018 17:47 Edited at: 12th Apr 2018 17:58
Well, I see the COS and SIN in AppGameKit already turn the angles into radians - so nevermind about the title topic.

My next problem is that is a weird looking circle. The sides are thicker than the top and bottom. Anyone have any experience in that?

puzzler2018
User Banned
Posted: 12th Apr 2018 18:44 Edited at: 12th Apr 2018 18:52
A createsprite like your doing will produce a box.

Try finer rotations using floats on the for loop




EDIT: then this will create a memory leak cause of having hundreds of sprites created, why not use a multiple ofDrawEllipse to create a circle and the getimage into a createsprite

Unsure how? - let us know and we can advise you
Golelorn
8
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 12th Apr 2018 19:15 Edited at: 12th Apr 2018 19:18
I am attempting to make a circular "progress" bar, so I do not believe drawellipse will work. But perhaps something similar... I will test that out.

I want to have only 1 sprite, but I do not know how to do that. I tried messing with the creatememblockfromimage, but I can't figure it out.

Golelorn
8
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 12th Apr 2018 19:30 Edited at: 12th Apr 2018 19:33
OK very cool. I will work on figuring out how to turn it into a sprite. Thanks for the guidance!

puzzler2018
User Banned
Posted: 12th Apr 2018 19:31
how about a createsprite to create the box
resize the sprite to say .1 x 1 to create rectangle

for loop the rectangle round the circlular way with setspriteangle

and then colour each sprite with the progress bar look and feel
puzzler2018
User Banned
Posted: 12th Apr 2018 19:34
Golelorn
8
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 12th Apr 2018 19:46 Edited at: 12th Apr 2018 19:47
This does the trick with only one sprite created! Thanks so much puzzlr

puzzler2018
User Banned
Posted: 12th Apr 2018 19:47
Well done
Golelorn
8
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 12th Apr 2018 21:32
Ugh, of course, on my laptop it works perfect. But on my mobile the sprite is about 3 X bigger... Anyone have any ideas?
puzzler2018
User Banned
Posted: 12th Apr 2018 21:33
try my last demo

Login to post a reply

Server time is: 2024-11-21 16:04:25
Your offset time is: 2024-11-21 16:04:25