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 / How do i make an array that contains multiple types (tier1)

Author
Message
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 8th Jan 2016 05:49
I have an array and i want it to describe a path so the array will contain

1. A starting x,y position and initial rotation
2. A series of commands to tell the object to rotate right/left or go straight
3. An ending x,y position and rotation

What is the best way to accommodate an idea like that? How can i have an array that will contain different data in each element?
BatVink
Moderator
20
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 8th Jan 2016 10:56
Quote: "How can i have an array that will contain different data in each element?"


An array is designed to have the same data in each element.
My suggestion would be:




The array lengths can be adjusted to suit your needs.
The command sub-array will be a set of instructions understandable to your program. For example:

MOVE,3
ROTATE,-2.5


You can split these down into the parameters.

Examples....





- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 8th Jan 2016 21:53
ok. thanks

Login to post a reply

Server time is: 2024-03-29 15:41:45
Your offset time is: 2024-03-29 15:41:45