Homebrew Is there somewhere on gbatemp.net to get help with homebrew creation?

jasonmbrown

Well-Known Member
OP
Newcomer
Joined
Sep 11, 2010
Messages
47
Trophies
0
XP
183
Country
Canada
Figured I would do something simple, and recreate space invaders for the 3ds. Since this is the first C++ Il have done (besides Making HelloWorlds for the wii, and tweaking the examples), I dont have much experience. And was wondering If there's somewhere on the forums to ask for help?

Currently, Don't have much done up Besides a simple way to create 8x8 sprites and animate them. I had one of them Moving left and right Just to make sure that there wasnt anything weird happening with the variables. However Now that Im drawing multiple "Invaders" It keeps drawing them diagonally which means I have a logic issue somewhere that I cant find...

if anyone wants to take a look feel free, This has the source as well as the buggy diagonal animated "invader" Besides that I havent done much lol. Just this has taken me all night XD.
Crappy Code.

So Ya If anyone wants to take a quick glance and see where I derped, and also If there's somewhere on the forums to post home-brew questions?

(code thats probably causing the issue)
Code:
int alien_layout[121] = {
    1,1,1,1,1,1,1,1,1,1,  1,0,0,0,0,0,0,0,0,0,
    1,1,1,1,1,1,1,1,1,1,  1,0,0,0,0,0,0,0,0,0,
    1,1,1,1,1,1,1,1,1,1,  1,0,0,0,0,0,0,0,0,0,
    1,1,1,1,1,1,1,1,1,1,  1,0,0,0,0,0,0,0,0,0,
    0,0,0,0,0,0,0,0,0,0,  0,0,0,0,0,0,0,0,0,0,
    0,0,0,0,0,0,0,0,0,0,  0,0,0,0,0,0,0,0,0,0,0
};

int get_xpos(alien_array_position){//Minimum 100px: Maximum 300px
   int xpos = 0;
   xpos = (150 + (alien_array_position * 13));//150
 
return xpos;
};
 
int get_ypos(alien_array_position){
    int ypos = 0;
    ypos = (50 + (alien_array_position * 11));//100
return ypos;
 
};
 

ILOVETOPLAYNESGA

Well-Known Member
Newcomer
Joined
Dec 21, 2010
Messages
53
Trophies
1
XP
334
Country
United States
Looking at the full code, if I understand it correctly (downloaded it and took a at draw.c mainly).
When you shift left and right, you are changing the array position?

Doing so then changes the y position in get_ypos by 11, so they go diagonally. You may want to consider making a multidimensional array instead, so that you can keep track of what y position each should be at anyway...

Actually, I am becoming a huge fan of entity component programming for games myself, which would be great for this.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Xdqwerty @ Xdqwerty: