Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - SaturnTeam

Pages: 1 2 [3] 4 5
31
I am trying to run the Storyboard demo from the C file with an attached header file, by linking the header file inside my game's main file. The name on both files matches. I added the external C file to the makefile. In the end, I'm trying to get it to work so I can gut it and make my own storyboard code. For the most part, it seems to be set up correctly, but I'm getting some errors.

Here is my header file code:
Code: [Select]
#ifndef __CLOUDS_H__
# define __CLOUDS_H__

void    my_draw(void);
void    my_gamepad(void);
void    animate_circular_saws(void);
void    animate_drone(void);
void    animate_sentry(void);
void    init_circular_saw_sprite_and_position(void);
void    init_drone_sprite_and_position(void);
void    init_sentry_sprite_and_position(void);
//void    jo_main(void);

#endif /* !__CLOUDS_H__ */

/*
** END OF FILE
*/

I commented out the jo_main section here and in the C file, because I assumed I needed to initialize the functions inside of jo_main in the main C file. I included the header file at the top of the external C file. Here is what I added in my main C file:
Code: [Select]
#include "clouds.h"

void     jo_main(void)
{
init_circular_saw_sprite_and_position();
init_drone_sprite_and_position();
init_sentry_sprite_and_position();
animate_circular_saws();
animate_drone();
animate_sentry();
}

When I try to compile the project, I get an error on the storyboard C file that "static jo_storyboard    *drone_storyboard;" has a syntax error before the * token. I get warnings on that part that the "type defaults to 'int' in declaration of 'drone_storyboard'", and that "data definition has no type or storage class". I also get a warning in the storyboard C file of "implicit declaration of function 'jo_storyboard_toggle'". Additionally, I get errors from the same file saying, "'jo_storyboard', 'storyboard', 'animation', 'jo_animation' undeclared". There are other related warnings, but I don't think I need to list all of them here. I haven't changed the code in the demo, other than commenting out the jo_main section and bringing up the same items inside of the jo_main in my main game file. I know this isn't super complicated, but I haven't tried doing this before. My main C file is getting too cluttered.

32
Jo Engine Wish List / Re: Expansion of Shooter Demo
« on: July 03, 2018, 03:22:25 am »
Okay. I'll take another look at that.

33
Jo Engine Wish List / Expansion of Shooter Demo
« on: July 03, 2018, 12:12:09 am »
I would like to request an enemy ship explosion feature, so that we can have an explosion animation happen when the laser hits the enemy ship. I have been trying to implement this, but have not figured it out. For now, I am going to work on other aspects of my game. Thank you.

34
General Jo Engine Help / Re: Can't get Every Day Cute copy to work
« on: July 03, 2018, 12:09:11 am »
I'm going to put in a feature request for the demo, and move on to other parts of the game.

35
General Jo Engine Help / Re: Can't get Every Day Cute copy to work
« on: July 02, 2018, 10:24:00 pm »
Yeah. Actually, when I redid them, I ran into the width problem. I fixed that. I was actually trying to get the animation to work so I could put it in my game file and try to attach it to the process of the laser hitting the enemy, which would show the animation. I couldn't figure out your coding suggestion and was trying to find a workaround. Unfortunately, I have not been successful. I think this will be the last day I will work on it before suspending my game. I am going to think about it. I can't continue without having the enemies explode. :'(

36
General Jo Engine Help / Re: Can't get Every Day Cute copy to work
« on: July 02, 2018, 09:10:35 pm »
Okay. I got it working. There seemed to be some kind of confusion in the program execution having to do with transparency colors. I went through and redid the TGAs. It's working perfectly, now.

37
This is such a frustrating problem. I copied the demo, and switched out the 4 TGA files with my own. I copied the TEX file and altered the file names inside. In the C file, i just changed the animation name. I kept the exact same structure. It just isn't working. I am getting an error in Yabause that it can't find the TGA files. The only thing that might be different about them is that they have a blue transparency background. Is there another way to create a TEX file other than copying it? It seems like it's just the names of the TGA files one after the other: "1.TGA2.TGA3.TGA4.TGA". I have never found any documentation or posts about making a TEX file, so I just assumed people created it in Notepad. Also, unlike my game project, when I try to compile this demo in Code Blocks, it returns an error saying it needs Visual Studio C++? I can still save the project. I don't have Visual Studio. I don't get what the problem is. Any help would be greatly appreciated. UPDATE: I tried copying the original demo TGAs into my copied folder and changing the TEX file back to how it was, but I am still getting an error saying it can't find the files. This makes me think that there is another way to create a TEX file.

38
Okay. Thanks for the tips on variables. I'll start back on this tomorrow.

39
Okay. That's good information. I appreciate the help. I will soldier on!

40
Okay, this is what I have after a few days. This is kind of a mess. I'll include the warnings/errors under the code.

Code: [Select]
#ifndef __ENEMY_H__
# define __ENEMY_H__

# define ENEMY_TILE_COUNT    (4)
/*
typedef enum
{
    NONE,
}                       e_ship;
*/

typedef struct
{
    int                   anim_id;
    char                  alive;
    char                  status;
    char                  max_anim_frames;
    char                  timer;
//    int                 x;
//    int                 y;
//    int                 speed;
//    t_ship_horiz_move   move;
      char                first_dead_sprite_id;
//    char                is_moving_horizontaly;
//    char                reverse_animation;
//    int                 shield_pos_x;
//    int                 shield_pos_y;
//    int                 shield_angle;
//    int                 score;
}                       e_ship;

#endif /* !__ENEMY_H__ */

I'm still not clear on what char items should be included in the structure and the implementation connection with the main file.

Code: [Select]
#include "enemy.h"

static e_ship    enemy;
static int          enemy_sprite_id;
static int          enemy_dead_sprite_id;

inline bool         explodeEnemy(jo_node *node)
{
        Sint32 curtime = jo_get_ticks();
        if(explodeEnemy != true)
        {
            jo_sprite_draw3D(enemy_sprite_id, node->data.coord.x, node->data.coord.y, 520);
        }
        else if(explodeEnemy == true)
        {
            jo_sprite_draw3D(enemy_dead_sprite_id, node->data.coord.x, node->data.coord.y, 520);
        }
        if(curtime > 99)
        {
            jo_sprite_draw3D(enemy_sprite_id, node->data.coord.x, node->data.coord.y, 520);
        }
}

inline void         renderEnemy(e_ship * enemy, char alive, char status, char max_anim_frames, char timer, jo_node *node)
{
    if (enemy->status & alive)
        Display(enemy);
    else if (enemy->timer ++ < max_anim_frames)
        Display(enemy + enemy->timer);
    else
        enemy->timer=max_anim_frames;
}

inline void         start_enemy_animation(e_ship enemy, char first_dead_sprite_id)
{
    jo_start_sprite_anim(enemy.anim_id);
//    enemy.reverse_animation = reverse_animation;
enemy.anim_id = jo_create_sprite_anim(first_dead_sprite_id, 4, 2);
}

void                init_game(void)
{
    jo_tile     enemy_tileset[ENEMY_TILE_COUNT] =
    {
        {0, 0, 40, 40},
        {40, 0, 40, 40},
        {80, 0, 40, 40},
        {120, 0, 40, 40},
    };

enemy_dead_sprite_id = jo_sprite_add_tga_tileset(JO_ROOT_DIR, "ENEMY.TGA", JO_COLOR_Blue, enemy_tileset, ENEMY_TILE_COUNT);
enemy_sprite_id = jo_sprite_add_tga(JO_ROOT_DIR, "EN.TGA", JO_COLOR_Blue);
enemy.anim_id = jo_create_sprite_anim(enemy_dead_sprite_id, ENEMY_TILE_COUNT, 4);

The compiler warns me that my early mention of static e_ship enemy shadows the global declaration. With the if explode enemy is true, the warning is about the comparison between pointer and integer. At the end of the explode section, it warns that there is no return statement in function returning non-void. There is a warning/error about using the term "display," because it doesn't know where this comes from and doesn't seem to be embedded in the engine. In the renderEnemy section, the status, timer, and node go unused. I realize that these are just mentioned, but not implemented. I don't know enough about it to do this. It also warns that at the end of the explodeEnemy section, "control reaches end of non-void function." I'm wondering if there is an easier way to implement an explosion, but I haven't figured it out yet.

41
Okay. Thanks. I'll integrate this idea and keep working on this tomorrow.

42
Okay, I spent most of the day trying to implement this, but I'm stuck, again. I want to share the pieces of code I do have.

Here is the header file:
Code: [Select]
#ifndef __ENEMY_H__
# define __ENEMY_H__

# define ENEMY_TILE_COUNT    (4)
/*
typedef enum
{
//    NONE,
}                       e_ship;
*/

typedef struct
{
    int                 anim_id;
//    int                 x;
//    int                 y;
//    int                 speed;
//    t_ship_horiz_move   move;
    char                is_alive;
    char                is_dead;
//    char                is_moving_horizontaly;
//    char                reverse_animation;
//    int                 shield_pos_x;
//    int                 shield_pos_y;
//    int                 shield_angle;
//    int                 score;
}                       e_ship;

#endif /* !__ENEMY_H__ */

I copied that from the ship header file, and changed it, but I'm not clear on changing the struct elements.

Here is code from the main C file. There are numerous mistakes, and obviously I left out the standard code:
Code: [Select]
#include "enemy.h"

static e_ship       enemy;
static int          enemy_sprite_id;
static int          enemy_dead_sprite_id;

inline bool         draw_enemy_dead(jo_node *node)
{
    jo_sprite_draw3D(enemy_dead_sprite_id, node->data.coord.x, node->data.coord.y, 520);
    node->data.coord.y += 2;
    if (jo_list_any(&enemies_list, check_if_laser_hit_enemy, node))
        get_enemy.anim_id();
}
inline void         start_enemy_animation(char check_if_laser_hit_enemy)
{
        jo_start_sprite_anim(enemy.anim_id);
enemy.anim_id = jo_create_sprite_anim(enemy_sprite_id, 4, 2);
}
void                init_game(void)
{
    jo_tile     enemy_tileset[ENEMY_TILE_COUNT] =
    {
        {0, 0, 40, 40},
        {40, 0, 40, 40},
        {80, 0, 40, 40},
        {120, 0, 40, 40},
    };
    enemy_dead_sprite_id = jo_sprite_add_tga_tileset(JO_ROOT_DIR, "ENEMY.TGA", JO_COLOR_Blue, enemy_tileset, ENEMY_TILE_COUNT);
    enemy_sprite_id = jo_sprite_add_tga(JO_ROOT_DIR, "EN.TGA", JO_COLOR_Blue);
    enemy.anim_id = jo_create_sprite_anim(enemy_dead_sprite_id, ENEMY_TILE_COUNT, 4);
}

The explosion animation is 4 tiles, from left to right. I didn't get to the curtime part, because I am having trouble setting up the code before that. I saw how the animation is handled in the sprite animation demo, but this is different with it being a whole game. The demo is just a changing sprite without outside interaction.

43
Okay. Thanks. I'll work on this another day. I'm out of time, today.

44
I have been trying to figure out how to tie in an explosion that is linked to an enemy ship being destroyed by the laser. I have been working on it for a while, looking through the code sections in the shooter demo. It's obvious where the enemy ships come in and the detection of whether an enemy ship has been hit and deleted, but I can't figure out how to input an explosion image to replace the enemy ship just vanishing into thin air. The closest I got was with adding an inline void and trying to tie it in with enemies being destroyed. It made it through the compiler, but nothing happened. I'm wondering if I need to create a header file for the enemy ship. I don't know if anyone can give me a hint. I know that Johannes considered this, because he left an explosion image in the directory.

45
General Jo Engine Help / Re: CD-DA Audio in Jo is broken...?
« on: June 26, 2018, 01:05:21 am »
Yeah, I downloaded it from the official site. I'll worry about it another day. I wasted hours on trying to get it to work.

Pages: 1 2 [3] 4 5
SMF spam blocked by CleanTalk