You Will Eveuntally Die
is a Android Game created with C Programming language and a beautiful library rawdraw
.
VadimBoev/CyberBird_unfinished
- Background Music Run Amok by Kevin MacLeod | https://incompetech.com/ Music promoted by https://www.chosic.com/free-music/all/ Creative Commons CC BY 3.0 https://creativecommons.org/licenses/by/3.0/
- Android Studio
- NDK
- Manage Folder Structure
- Sepearte Game code from rawdraw in
lib
folder - Add
init
andgame_loop
functions - Load images from assets
- Create Menu Based Navigation
- Open link in external apps
- Create complete game
- Add collision Detection
- Add Sound in Game with libbass
- Make Sound Stop when HOME button or NAVIGATE Button is pressed
The base game folder and assets folder is seperated from the base rawdrawandroid folder(renamed as giga due to submodule issue)
- All the game codes must/should/are placed inside the
lib
folder. - All the images and assets should be placed in
assets
folder. - There must be one
launch.c
file inside thelib
folder as it is the entry point of application. - The basic launch.c code looks like this.
#include "framework.c" // contains all the helper functions for loading images, buttons, etc.
void init() {
// code that must be called once before the game enters the gameloop
// for example, loading all the textures, etc
}
void gameloop() {
// the actual gameloop, do all the game stuffs here,
// this is just passed to a while loop that runs continuously
// until program is exited.
}
void HandleResume()
{
suspended = 0;
// things you want to do when the app reesumes, like reinitialize/reload the images from assets
}
void HandleSuspend()
{
suspended = 1;
// things you want to do when the app is suspended
}
// Entry Point of the Game
int main()
{
// must pass the two functions to the run function in order to work
// run function is inside giga/framework.c file.
run(init, gameloop);
return 0;
}
- To run the project first generate the keystroke by
make keystore
command and run./build.sh
for building the apk na drunning in your phone.
- Create a text at specified coordinate
CNFGPenX = 100;
CNFGPenY = 100;
CNFGSetLineWidth(10);
CNFGDrawText("YOU WILL EVENTUALLY DIE!", 15);
- Open a url in external app
OpenUrl("https://facebook.com);
- Image button
ImageButton(void onClick(), image *img, short xmin, short ymin, short width, short height);
- Button
Button(void onClick(), const char *title, int backgroundcolor, int textcolor, int xmin, int ymin,int xmax, int ymax);
- Rendering Images
image *backgroud1;
void init() {
backgroud1 = loadimagefromapk("sky.png");
backgroud1->tex = CNFGTexImage(backgroud1->rdimg, backgroud1->w, backgroud1->h);
}
void gameloop() {
RenderImage(backgroud1->tex, 0, 0, screenx, screeny);
}
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.