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 / Stuck: making a trail of sprites, whose positions are determined by array

Years of Service
User Offline
Joined: 10th Feb 2015
Posted: 16th Feb 2015 23:01
I think this is a problem of my sync() but unsure, so thought I'd ask you folks if anyone can nudge me.

Basically, I want a sprite in every position that I have in an array, currently my code only prints the last element in the array, whereas I want the sprite to remain static, so every array element should be displaying a sprite.

Any ideas how I can make the sprites remain static?

Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 16th Feb 2015 23:39 Edited at: 16th Feb 2015 23:40
This is your code modified to work. I replaced your circle with a plain sprite just for ease of testing the code.

The main issue is that you only ever created one sprite. So when you went through the array, you simply moved a single sprite around the screen, then synced it at the last position.

I've also replaced your 2 arrays with one typed array. This allows the numerous sprites you need to be saved alongside their coordinates.

Quidquid latine dictum sit, altum sonatur
Years of Service
User Offline
Joined: 10th Dec 2014
Posted: 17th Feb 2015 01:45
The "need x and y coordinates" workaround I've been using


It's mean time. *averages*

Login to post a reply

Server time is: 2023-03-22 06:09:42
Your offset time is: 2023-03-22 06:09:42