Hello Guest, please login or register.
Did you miss your activation email?
Login with username, password and session length.

Pages: [1]   Go Down

Author Topic: PALIB:sticking variables together?  (Read 744 times)

0 Members and 1 Guest are viewing this topic.

Linky628

PALIB:sticking variables together?
« on: January 19, 2007, 07:45:23 am »
ok,so i have two vars,
mapx
and
mapy

the info they have is the area link is in.
in my game,the world is divided into a 7x7 grid.
to see which map im on,i need to
stick mapx and mapy together,so ill have the 3 var,mapxy.

so heres the thing,
if
mapx =4
and
mapy =3
how do i make mapxy=4,3?
Logged
Re: PALIB:sticking variables together?
« Reply #1 on: January 19, 2007, 10:59:27 am »
  • Minalien
  • *
  • Reputation: +10/-1
  • Offline Offline
  • Gender: Female
  • Posts: 2119
I dont think you can, but I'm not sure off the top of my head. I dont see why you would want to, anywyas.

Code: C
  1. if( ( mapx == 4 ) && ( mapy == 3 ) )
  2. {
  3.      // TODO: Add your code here+
  4. }
is about the best way to do it that I can think of ;/

[Edit]
You could use an array:
Code: C
  1. const int X = 0;
  2. const int Y = 1;
  3. int map[2];
  4. map[X] = 4;
  5. map[Y] = 3;
though it would just be the essentially same as what you're doing.
« Last Edit: January 19, 2007, 11:01:05 am by Madilim Kagalakan »
Logged
Quote
There's such a double standard about religion in the modern world. Catholics can gather, wear white robes, and say "In nomine Patris, et Filii, et Spiritus Sancti" and be considered normal.

But if my friends and I gather, wear black robes, and say  "Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn", we're considered cultists.
  • Development Blog

Linky628

Re: PALIB:sticking variables together?
« Reply #2 on: January 20, 2007, 03:27:31 am »
that add like 50 more lines to the code,saying
BG0=("MAP_"+ mapxy)
is much easier
Logged
Pages: [1]   Go Up

 


Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved



Page created in 0.127 seconds with 44 queries.

anything