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.

AppGameKit Studio Chat / Moving Sprites in a fast easy way

Author
Message
Game_Code_here
3
Years of Service
User Offline
Joined: 2nd Jun 2020
Location:
Posted: 14th Mar 2021 05:43
So I am using this to move my player sprite, it works but is very slow as my player moves real slow.

is there a better way?

PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 14th Mar 2021 07:41
When you copyNpaste code it helps to read the footnotes:

Quote: "The move variable is used as a way of saying how far we are along the line to our new destination. Initially it is 0, and after a user has touched / clicked the screen and the sprite starts moving, it gets incremented by 2 pixels each frame. Once it is greater than or equal to the distance value we know our sprite has reached its location."


se we know its being moved by 2 pixels, find the 2 and change it

add a global variable, somewhere, "varPalyerSpeed=5"

change this block


to this:


and adjust "varPalyerSpeed" to suite your needs
Game_Code_here
3
Years of Service
User Offline
Joined: 2nd Jun 2020
Location:
Posted: 14th Mar 2021 08:00
PartTimeCoder

thanks for your help

I did not read the foot notes lol

Login to post a reply

Server time is: 2024-03-29 02:31:02
Your offset time is: 2024-03-29 02:31:02