I want to dabble in some c so I wanted to make LOA. Since there is Oiram, why not The Legend Of Adlez. Right now the world map is divided into 4 quadrants, because I had difficulty with the tilemap world height and size being displayed. At the moment, link can freely move around the world without colliding into anything.



link.8xp

Github

I have some questions:
1. Should I have everything in one file. I have my sprites and quadrants in the same program file as the game, instead of having them in Appvars?

2. Is there a better way of clearing link? I have a "buffer" using a function.

Code:
#include "includes.h"
#include "render.h"
#include "animate.h"
#include "link.h"
#include "processEvents.h"
//#include "moveScreen.h"

void render(gameState *game, Link *link, gfx_tilemap_t *tilemap, unsigned *x_offset, unsigned *y_offset) {
    gfx_TransparentSprite_NoClip(link->clear, link->x, link->y);

    animate(game, link);
    //moveScreen(link, tilemap, x_offset, y_offset);
    processEvents(game, link, tilemap);

    gfx_GetSprite(link->clear, link->x, link->y);
    gfx_TransparentSprite_NoClip(link->sprites[link->direction], link->x, link->y);
    gfx_BlitBuffer();
}

The processEvents has a long enough "buffer" to where link doesn't leave a trail. processEvents would be in main.c, while moveScreen would be in render.c; I have them flipped for the purpose of having link not leaving a trail.

3. Also how does the gfx_GetTile work. Is it possible for me to use it as a form of collision detection?
Awesome work so far! Very Happy

1. Separate files is fine. It would be a little bit easier to use I imagine; you can use convhex to convert binary files directly to appvars.

2. Yes; although it may be somewhat weird; it would be much simpler to redraw the entire tilemap each frame. Just execute a call to gfx_Tilemap in your main loop.

3. gfx_GetTile returns a pointer to the tile with the given pixel coordinates. So if you do *gfx_GetTile, you will get the value of the tile; which you can use to check collisions.

Good luck! I see many optimizations in your code; I may suggest some thing later on Smile
That looks Great! Good luck in development! Smile
Wow, that looks really cool. Very Happy

Btw, for someone who knows C#, would programming calculators in c be easier than assembly?
I don't know C#, but C would probably be easier.
This looks great! Awesome job so far Smile

Switchblade wrote:
Wow, that looks really cool. Very Happy

Btw, for someone who knows C#, would programming calculators in c be easier than assembly?
Depends on how experienced you are with C#, and how good your knowledge of pointers, etc. is. I feel that if you're interested in learning Assembly, then definitely do it. I think it's a great exercise for any programmer.

Of course, C is also a great language to know too. I've not tried doing any C coding on the 84+CE yet, but a lot of people have been putting it to good use! Smile
Oh, yeah, I'm intent on learning asm. I have made a program so far that uses the up and down keys to switch between three different screens. I feel like I don't quite understand asm, but that I am just on the verge of "oh, I get it!"

Btw, SQRXZ is looking incredible! Very Happy
Wow looking really cool and another great showcase for the power of C on the CE Smile.
Looks really great, and yay, another C program! Wink
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement