Snake game with mouse control

The Partridge Family were neither partridges nor a family. Discuss.
Post Reply
aslanbey0158
Posts: 52
Joined: April 15th, 2017, 10:48 am

Snake game with mouse control

Post by aslanbey0158 » September 23rd, 2017, 8:54 pm

i want to control snek with mouse. For this reason i must change some int to float.
Where can i do?
Attachments
UYG 15.rar
(9.72 MiB) Downloaded 132 times

User avatar
Yumtard
Posts: 575
Joined: January 19th, 2017, 10:28 pm
Location: Idiot from northern Europe

Re: Snake game with mouse control

Post by Yumtard » September 24th, 2017, 12:45 am

I don't quite understand what problem you're having.

But you could prob just typecast to int for the mouse position.

like
Int x = int(wnd.mouse.GetPosX());

User avatar
chili
Site Admin
Posts: 3948
Joined: December 31st, 2011, 4:53 pm
Location: Japan
Contact:

Re: Snake game with mouse control

Post by chili » September 24th, 2017, 6:16 am

Yumtard wrote:I don't quite understand what problem you're having.

But you could prob just typecast to int for the mouse position.

like
Int x = int(wnd.mouse.GetPosX());
I think he wants to convert from int to float :)

Not sure why you would want to convert the mouse coords into float in the first place... Just use the int output from GetPosX(). Snek is not really a 'floaty' game to begin with.
Chili

albinopapa
Posts: 4373
Joined: February 28th, 2013, 3:23 am
Location: Oklahoma, United States

Re: Snake game with mouse control

Post by albinopapa » September 24th, 2017, 7:40 am

I think he wants to modify it so it makes smooth movement, like slither.io.
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com

Post Reply