Help Programming

mat88

Well-Known Member
OP
Member
Joined
Jun 21, 2003
Messages
169
Trophies
0
Age
36
Location
Montreal
Website
Visit site
XP
216
Country
Canada
Hi,
I'm trying to program the scrolling of a background (NDS) and it's working. The only problem is, when I continu to press on the left et we are at the limit, the background stop (ok) but the value of scrolling continu to decrease (not ok). I tryed put a condition if to bloc the value to zero but it didn't work.

there is a part of the code
hate2.gif

CODEÂÂÂÂscrollx += (Pad.Held.Right - Pad.Held.Left);
ÂÂÂÂscrolly += (Pad.Held.Down - Pad.Held.Up);
ÂÂÂÂif(scrollx
 

CockroachMan

Scribbling around GBATemp's kitchen.
Member
Joined
Jan 14, 2006
Messages
3,887
Trophies
0
Age
38
Location
Brazil
Website
www.homembarata.com.br
XP
707
Country
Brazil
How do you know that the values are decreasing? Are you using something to print the values for you?

Anyway.. are you using unsigned variables? That can lead to overflow and keep your variables always positive..
 

mat88

Well-Known Member
OP
Member
Joined
Jun 21, 2003
Messages
169
Trophies
0
Age
36
Location
Montreal
Website
Visit site
XP
216
Country
Canada
I use u32 scrolly, scrollx
Yes I have a debug function that print it.

Code:
ÂÂÂÂPA_InitText(0,2);
ÂÂÂÂPA_OutputText(0,1,6,"Position: (x=%d;y=%d)",scrollx,scrolly);

Between I use PAlib to code on DS
 

mat88

Well-Known Member
OP
Member
Joined
Jun 21, 2003
Messages
169
Trophies
0
Age
36
Location
Montreal
Website
Visit site
XP
216
Country
Canada
I have an other problem
shy.gif

I need help with a table of string
CODE#include or? #include
int main(int argc, char ** argv)
{
string city[10]={"Ville départ","Port1"}; or? std::string city[10]={"Ville départ","Port1"};
}
I'm using Devkitpro whit PAlib (using the build.exe)
 

CockroachMan

Scribbling around GBATemp's kitchen.
Member
Joined
Jan 14, 2006
Messages
3,887
Trophies
0
Age
38
Location
Brazil
Website
www.homembarata.com.br
XP
707
Country
Brazil
You can use

CODE#include
using namespace std;
int main(int argc, char ** argv)
{
string city[10]={"Ville départ","Port1"};
}

or

CODE#include
int main(int argc, char ** argv)
{
std::string city[10]={"Ville départ","Port1"};
}

same result..
 

Mangofett

GBAtemp Testing Area
Member
Joined
May 14, 2006
Messages
4,885
Trophies
1
Age
19
XP
1,060
Country
United States
And while we're on discussion of PAlib, how would I go about assigning array values to sprites? like if I have something like arrayx[10] and araayy[7], and I have an actual grid with sprites on screen.
 

mat88

Well-Known Member
OP
Member
Joined
Jun 21, 2003
Messages
169
Trophies
0
Age
36
Location
Montreal
Website
Visit site
XP
216
Country
Canada
thank you, it's working now!

but my next problem is coming.
Is it possible to have 2 PA_InitText? (in different function)

like
Code:
function1()
{PA_InitText(0,2);}
function2()
{PA_InitText(1,2);}

int main()
{
while(1)
{
function1();
function2();
}
}
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • Psionic Roshambo @ Psionic Roshambo:
    Also a food allergy study would be a good idea
  • K3Nv2 @ K3Nv2:
    Turns out you can't sprinkle methamphetamine on McDonald's French fries
    +1
  • ZeroT21 @ ZeroT21:
    they wouldn't be called french fries at that point
    +1
  • ZeroT21 @ ZeroT21:
    Probably just meth fries
    +1
  • K3Nv2 @ K3Nv2:
    White fries hold up
    +1
  • The Real Jdbye @ The Real Jdbye:
    @K3Nv2 sure you can
  • BakerMan @ BakerMan:
    why tf do people hate android users? is it the video quality? just because "AnDrOiD = pOoR" bc they don't cost an arm and a leg like iphones do?
    +1
  • BakerMan @ BakerMan:
    i won't be turned off by an iphone, but don't pick on me for having an android, that's just how this shit should work
  • ZeroT21 @ ZeroT21:
    Should say more what these kind of android users say bout nokia 3310 users
  • BigOnYa @ BigOnYa:
    I've owned both iPhone and Androids over the years. Both are just as good, other than Apples higher price. I'm currently on Android, Samsung S21 I think, and very happy with it.
  • K3Nv2 @ K3Nv2:
    Got my 60 minute steps in whew
    +2
  • BigOnYa @ BigOnYa:
    I get mine in everyday, going back n forth to the fridge for a beer.
    +1
  • K3Nv2 @ K3Nv2:
    6,000 steps in so far legs almost broke getting off
    +1
  • K3Nv2 @ K3Nv2:
    Your mind gets in a werid pattern of just finishing then when you're done you're like I need a soda
  • BigOnYa @ BigOnYa:
    You get a "walkers" high?
  • K3Nv2 @ K3Nv2:
    Not really I just use to love building up a sweat
  • BigOnYa @ BigOnYa:
    Funny, that's what uremum always says
  • K3Nv2 @ K3Nv2:
    Yeah and people that take viagra think they have a big dick
    +1
  • K3Nv2 @ K3Nv2:
    You cant fix one insult edit for another edit you pog
  • BigOnYa @ BigOnYa:
    Nuh I'm on my tablet n it always auto corrects me
  • K3Nv2 @ K3Nv2:
    Heorin and uremum do have close quarters
  • Sonic Angel Knight @ Sonic Angel Knight:
    BIG CHICKEN :P
    K3Nv2 @ K3Nv2: https://youtu.be/q855tNpvDoQ?si=Tl57KMjiVjyBherB +1