0 Favourites

Global Vars vs Array System - performance difference?

  • Hi folks,

    I want to know if it impacts my games performance, say on mobile devices

    (which i cant test atm because I am on the Free Edition)

    if I use Global Variables instead of an Array to:

      Store Angle Data of up to 20 Objects all the time after manipulation Measure constantly distances between my 20 Objects and the Mouse Cursor position Manipulate Angle Data of any of the 20 objects next after next

    All my data manipulation comes mainly from the mouse cursor position.

    I am new - so if this question has an absolute "no why would it have an impact - makes no sense?!" answer then please excuse.

    Just need to know HOW I build my project further in the right direction from the beginning as you surely understand.

    Oh and - why Mouse on Mobile Device? I want to transform my mouse interactions in touch interactions later...

    Cheers,

    Solano

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • There shouldn't be any performance impact using one over the other. Using 20 global variables will be a pain to use so arrays are the way to go for this.

    Although, it seems instance variables (each object) would be better still. Then it's only a matter of doing a FOR EACH OBJECT and reading / writing the values.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
331 35,574
Lordshiva1948's avatar
Lordshiva1948
Unread hot topic
234 61,257
DARKSETH's avatar
DARKSETH
Unread hot topic
157 12,700
megatronx's avatar
megatronx