Skip to content

Commit

Permalink
Finished espitene (bar testing), propagated changes to everything, te…
Browse files Browse the repository at this point in the history
…sted, fixed, got dizzy
  • Loading branch information
mojontwins committed Aug 31, 2018
1 parent 8d91cc4 commit 88ee89d
Show file tree
Hide file tree
Showing 303 changed files with 9,843 additions and 6,639 deletions.
8 changes: 5 additions & 3 deletions examples/07_cheril_perils_classic/dev/assets/behs.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,21 @@

// Add these:
// + 1 kills (useless if + 8 obstacle)
// + 2 quicksands ( " , needs ENABLE_QUICKSANDS)
// + 4 platform (side view)
// + 8 obstacle (nullifies + 1 & + 2, see bellow)
// +16 breakable
// +32 conveyor (pushes left, + 1 pushes right)
// +64 slippery

// Special values (= nonsensical combinations):
// 2 quicksands ( " , needs ENABLE_QUICKSANDS)
// 9 not safe block (safe spot not saved when jumping off this)
// 10 lock
// 11 pushable
// 32 ladder (== 32, no obstacle!)
// 64 float (== 64, no obstacle!)
// 32 ladder (== 32, no obstacle!)
// 34 tile_get (== 34, no obstacle!)
// 64 float (== 64, no obstacle!)
// 74 trampol. (== 74, obstacle!)

const unsigned char behs0 [] = {
0, 0, 0, 0, 8, 8, 8, 8, 0, 8, 0, 0, 1, 8, 4,10,
Expand Down
1 change: 1 addition & 0 deletions examples/07_cheril_perils_classic/dev/assets/levelset.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const unsigned char l_scr_ini [] = { 20, 20, 8 };
const unsigned char l_ini_x [] = { 2, 2, 2 };
const unsigned char l_ini_y [] = { 7, 10, 3 };
const unsigned char l_map_w [] = { 4, 4, 8 };
const unsigned char l_map_h [] = { 6, 6, 3 };

// Ending screen & position, per level (comment if N/A)

Expand Down
9 changes: 9 additions & 0 deletions examples/07_cheril_perils_classic/dev/assets/precalcs.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,12 @@
CHAC_CHAC_BASE_TILE + 6, CHAC_CHAC_BASE_TILE + 1, CHAC_CHAC_BASE_TILE + 3, CHAC_CHAC_BASE_TILE + 5, CHAC_CHAC_BASE_TILE + 3, CHAC_CHAC_BASE_TILE + 1
};
#endif

const unsigned char bits [] = {
1, 2, 4, 8, 16, 32, 64, 128
};

#ifdef ENEMS_MAY_DIE
const unsigned char jitter [] = { 0,1,1,0,0,1,0,1,1,0,0,0,1,0,1,1 };
#endif

24 changes: 20 additions & 4 deletions examples/07_cheril_perils_classic/dev/autodefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@

// Inner workings. Don't touch.

#define MONOCOCO_COUNTER _en_my
#define MONOCOCO_STATE _en_mx
#define CATACROCK_WAIT _en_mx

#if defined (ENABLE_MONOCOCOS) || (defined (ENABLE_COMPILED_ENEMS) && defined (COMPILED_ENEMS_SHOOT))
#define ENABLE_COCOS
Expand All @@ -25,11 +24,15 @@
#define PLAYER_CAN_FLOAT
#endif

#if defined (ENABLE_LADDERS) || defined (ENABLE_PROPELLERS) || defined (ENABLE_SPRINGS)
#if defined (ENABLE_LADDERS) || defined (ENABLE_PROPELLERS) || defined (ENABLE_SPRINGS) /*|| defined (ENABLE_TRAMPOLINES)*/
#define NEEDS_INITIAL_DETECTION
#endif

#if defined (PLAYER_STEPS_ON_ENEMS) || defined (PLAYER_CAN_FIRE) || defined (PLAYER_KICKS) || defined (PLAYER_PUNCHES) || defined (ENEMIES_SUFFER_ON_PLAYER_COLLISION) || defined (FANTY_KILLED_BY_TILE)
#if defined (ENABLE_TILE_GET) || defined (CUSTOM_CENTER_DETECTIONS)
#define NEEDS_CENTER_DETECTION
#endif

#if defined (PLAYER_STEPS_ON_ENEMS) || defined (PLAYER_CAN_FIRE) || defined (PLAYER_KICKS) || defined (PLAYER_PUNCHES) || defined (ENEMIES_SUFFER_ON_PLAYER_COLLISION) || defined (FANTY_KILLED_BY_TILE) || defined (PLAYER_SPINS)
#define ENEMS_MAY_DIE
#endif

Expand Down Expand Up @@ -75,6 +78,10 @@
#define MAP_RENDERER_COMPLEX
#endif

#if defined (ENABLE_TILE_GET) && defined (PERSISTENT_TILE_GET)
#define MAP_RENDERER_COMPLEX
#endif

#if defined (ENABLE_BREAKABLE) && BREAKABLE_LIFE == 1
#define BREAKABLES_SOFT
#endif
Expand All @@ -95,3 +102,12 @@
#if defined (ENABLE_CHAC_CHAC) || defined (ENABLE_TILE_CHAC_CHAC)
#define ENABLE_SHAKER
#endif

#if defined (ENABLE_FANTY) || defined (ENABLE_HOMING_FANTY) || defined (ENABLE_TIMED_FANTY) || defined (ENABLE_BOIOIONG) || defined (ENABLE_CATACROCKS)
#define ENEMS_NEED_FP
#endif

#if defined (PLAYER_TOP_DOWN) && defined (NO_HORIZONTAL_EVIL_TILE)
#undef NO_HORIZONTAL_EVIL_TILE
#endif

Binary file modified examples/07_cheril_perils_classic/dev/cart.nes
Binary file not shown.
99 changes: 79 additions & 20 deletions examples/07_cheril_perils_classic/dev/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
//#define GAME_AREA_BOTTOM
#define GAME_AREA_CUSTOM

#define MAP_CLEAR_LIST_ADDRESS 0x2c40 // To store map persistence in VRAM.
// Each screen takes 24 bytes. move it where
// It fits. Below 2c40 you may "see" the buffer

// ============================================================================
// I. General configuration
// ============================================================================
Expand Down Expand Up @@ -62,8 +66,6 @@
#define HOTSPOT_TYPE_RESONATOR 4 // An example of custom hotspot
#define HOTSPOT_TYPE_RESONATOR_ON 5 // Custom for this game.

//#define HOTSPOT_TYPE_STAR 4 // Stars are extra collectibles

#define WIN_LEVEL_CUSTOM // A level ends when win_level == 1
// And such a thing has to be setup by YOU

Expand Down Expand Up @@ -113,7 +115,7 @@

// Push boxes

//#define PLAYER_PUSH_BOXES // If defined, tile #14 is pushable
//#define PLAYER_PUSH_BOXES // If defined, tile beh 11 is pushable
#define FIRE_TO_PUSH

//#define ENABLE_PUSHED_SCRIPT
Expand All @@ -125,17 +127,19 @@

//#define DEACTIVATE_KEYS // If defined, keys are not present.
#define DEACTIVATE_OBJECTS // If defined, objects are not present.
//#define PLAYER_BOUNCES
//#define PLAYER_BOUNCES 16
//#define DOUBLE_BOUNCE
#define DIE_AND_RESPAWN // If defined, dying = respawn on latest safe.
//#define DIE_AND_REENTER // ... also, reenter screen on death
#define PLAYER_FLICKERS // If defined, collisions make player flicker instead.
//#define WALLS_STOP_ENEMIES // If defined, enemies react to the scenary
#define DIE_AND_RESPAWN // If defined, dying = respawn on latest safe.
//#define DIE_AND_REENTER // ... also, reenter screen on death
//#define DIE_AND_REINIT // ... or start the level over!
#define PLAYER_FLICKERS 100 // If defined, collisions make player flicker for N frames
//#define WALLS_STOP_ENEMIES // If defined, enemies react to the scenary

// Extra special tiles
// -------------------

//#define NO_HORIZONTAL_EVIL_TILE // Only check for evil tiles vertically
//#define NO_HORIZONTAL_EVIL_TILE // Only check for evil tiles vertically
//#define CUSTOM_CENTER_DETECTIONS // Define this if you need custom tile behs

// Quicksands, beh == 2.
// For player movement values, see section 4
Expand All @@ -144,14 +148,14 @@
//#define ENABLE_QUICKSANDS

// Breakable, beh & 16
//#define ENABLE_BREAKABLE // Breakable walls
#define BREAKABLE_LIFE 2 // Amount of hits to break wall
#define BREAKABLE_ANIM // Show explosion when breaking
#define BREAKABLE_MAX 4 // Max # of concurrent explosions
#define BREAKABLE_MAX_FRAMES 8 // Frames to show explosion
#define BREAKABLE_ERASE 0 // Tile to erase broken tiles
#define BREAKABLE_BREAKING 8 // Tile to display while breaking
//#define BREAKABLE_WALKABLE // If defined (side view), tiles break when stepped on
//#define ENABLE_BREAKABLE // Breakable walls
#define BREAKABLE_LIFE 2 // Amount of hits to break wall
#define BREAKABLE_ANIM // Show explosion when breaking
#define BREAKABLE_MAX 4 // Max # of concurrent explosions
#define BREAKABLE_MAX_FRAMES 8 // Frames to show explosion
#define BREAKABLE_ERASE 0 // Tile to erase broken tiles
#define BREAKABLE_BREAKING 8 // Tile to display while breaking
//#define BREAKABLE_WALKABLE // If defined (side view), tiles break when stepped on

// Conveyors, beh & 32 [+1] (must be & 8!)
// For player movement values, see section 4
Expand All @@ -169,6 +173,17 @@

//#define ENABLE_LADDERS

// Special, "collectable" map tiles.
// beh == 34

//#define ENABLE_TILE_GET
//#define PERSISTENT_TILE_GET

// Trampolines. Needs PLAYER_VY_TRAMPOLINE
// beh == 66

//#define ENABLE_TRAMPOLINES

// Extra special stuff
// -------------------

Expand Down Expand Up @@ -254,11 +269,15 @@
//#define ENEMS_IN_CHRROM // Enems are stored somewhere in CHR-ROM

#define ENEMS_LIFE_GAUGE 1 // Amount of shots/punches/kicks needed to kill enemies.
//#define NEEDS_LIFE_GAUGE_LOGIC // This is activated automaticly when needed, but you can
// do it yourself if you need it to do customs...

//#define ENEMS_FLICKER // Ifdef: flicker, if not: explosion
//#define ENEMS_FLICKER_ONLY_ON_DYING // Flicker, but only when life == 0

//#define ENEMS_CAN_RESPAWN // Read docs for this.

//#define ENEMS_TREMBLE // Make enemies tremble when hit

#define PERSISTENT_ENEMIES
#define PERSISTENT_DEATHS

Expand All @@ -276,10 +295,11 @@
// Beware: only activate this if enemies are killable by any means:
//#define ENEMIES_SUFFER_ON_PLAYER_COLLISION

// Fanties / Homing fanties
// Fanties / Homing fanties / Timed fanties

//#define ENABLE_FANTY
#define ENABLE_HOMING_FANTY
//#define ENABLE_TIMED_FANTY

#define FANTY_BASE_SPRID 32
#define FANTY_WITH_FACING
Expand All @@ -289,10 +309,13 @@

#define FANTY_A 2
#define FANTY_MAXV 32
//#define FANTY_FAST_ANIM // If defined, cells A/B are changed every frame (for transparency effects)

#define FANTY_DISTANCE 96
#define FANTY_V_RETREAT 16

#define FANTY_BASE_TIMER 120 // Timed fanties use this

// Pursuers (for top-down)

//#define ENABLE_PURSUERS // If defined, type 7 enemies are active
Expand Down Expand Up @@ -369,6 +392,24 @@
#define COMPILED_ENEMS_SHOOT
#define COMPILED_ENEMS_BASE_SPRID 48

// Boioiongs

//#define ENABLE_BOIOIONG
#define BOIOIONG_G 16
#define BOIOIONG_VY_MAX 256
#define BOIOIONG_BASE_SPRID 54
//#define BOIOIONG_ACTIVE_BY_DEFAULT // Define and they are active by default
//#define BOIOIONG_INITIAL_TIMER 200 // If active by default, time to be active in frames
//#define BOIOIONG_AUTO_RESPAWN

// Catacrocks

//#define ENABLE_CATACROCKS
#define CATACROCK_G 16
#define CATACROCK_MAX_V 256
#define CATACROCK_CROCK_FRAMES 50
#define CATACROCK_BASE_SPRID 50

// Cocos will get enabled automaticly on choosing monococos or shooties.

//#define ENABLE_COCOS
Expand Down Expand Up @@ -464,16 +505,23 @@
// Side view:
// ----------

// Choose ONE or SEVERAL of those.
// If you choose several, use the vertical_engine_type variable to select

#define PLAYER_HAS_JUMP // If defined, player is able to jump.
#define PLAYER_JUMP_TYPE_MK2 // Use MK2 method for jump / gravity / release
//#define PLAYER_AUTO_JUMP // Automatic jump when hitting the floor
//#define PLAYER_SWIMS // If defined, player swims a la Ninjajar!
//#define PLAYER_HAS_JETPAC // If defined, player can thrust a vertical jetpac

// Extra configuration for side view:

//#define PLAYER_JUMP_TYPE_MK2 // Use MK2 method for jump / gravity / release
#define PLAYER_STEPS_ON_ENEMS // If defined, stepping on enemies kills them
#define PLAYER_STEPS_STRICT // Only registers advantage hit when pvy > PLAYER_VY_FALLING_MIN
#define PLAYER_SAFE_LANDING // Step over vertical inverts direction
//#define PLAYER_STEPS_MIN_KILLABLE 0xff // Only kill enemies with id >= PLAYER_STEPS_MIN_KILLABLE
// 0xff = Nobody
//#define PLAYER_SPINS // Spins on DOWN and JUMP and kills baddies

// ============================================================================
// III. Screen configuration
Expand Down Expand Up @@ -524,6 +572,7 @@
#define PLAYER_G 8 // Gravity

#define PLAYER_VY_JUMP_INITIAL 64
#define PLAYER_VY_JUMP_INITIAL_TRAMPOLINE 128
#define PLAYER_VY_JUMP_MAX 160 // Max. velocity when jumping
#define PLAYER_AY_JUMP 12 // Jumpin acceleration

Expand All @@ -546,6 +595,8 @@
#define PLAYER_VY_MK2_JUMP_INITIAL 160
#define PLAYER_VY_MK2_JUMP_RELEASE 80
#define PLAYER_VY_MK2_JUMP_A_STEPS 16
#define PLAYER_VY_MK2_JUMP_INITIAL_TRAMPOLINE 296
#define PLAYER_VY_MK2_TRAMPOLINE_A_STEPS 32 // For trampolines

// IV.2. Horizontal (side view) or general (top view) movement.

Expand Down Expand Up @@ -588,6 +639,9 @@
#define CELL_WALK_INIT 1
#define CELL_WALK_CYCLE 1
#define CELL_AIRBORNE 5

#define CELL_SPIN_CYCLE 5

#define CELL_ASCENDING 5
#define CELL_DESCENDING 6

Expand All @@ -598,6 +652,8 @@
#define CELL_PUNCHING 8
#define CELL_KICKING 9

#define CELL_HIT 9

#define CELL_CLIMB_CYCLE 20
#define CELL_CLIMB_HALF 29
#endif
Expand All @@ -612,6 +668,7 @@
#define SFX_TILE 1
#define SFX_OBJECT 2
#define SFX_USE 3
#define SFX_TRAMPOLINE 3
#define SFX_PHIT 4
#define SFX_DUMMY1 5
#define SFX_ENHIT 6
Expand All @@ -626,3 +683,5 @@
#define SFX_STEPON 15
#define SFX_FLOAT 16
#define SFX_BREAKB 17
#define SFX_RING 18
#define SFX_FANFARE 19
4 changes: 3 additions & 1 deletion examples/07_cheril_perils_classic/dev/crt0.s
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ FT_SFX_STREAMS =4 ;number of sound effects played at once, can be 4 or less (f
.define FT_DPCM_ENABLE 0 ;zero to exclude all the DMC code
.define FT_SFX_ENABLE 1 ;zero to exclude all the sound effects code

.define SPEED_FIX 1 ;zero if you want to handle PAL/NTSC speed difference by yourself
.define SPEED_FIX 0 ;zero if you want to handle PAL/NTSC speed difference by yourself

.export _exit,__STARTUP__:absolute=1
.import push0,popa,popax,_main,zerobss,copydata
Expand Down Expand Up @@ -71,6 +71,8 @@ RAND_SEED =$1a ;word
PALUPDATE =$1c

TEMP =$1d
SCROLL_X1 =$1e ;Added by mojon twins
PPU_CTRL_VAR1=$1f ;Added by mojon twins

PAD_BUF =TEMP+1

Expand Down
7 changes: 7 additions & 0 deletions examples/07_cheril_perils_classic/dev/definitions.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,10 @@

#define EN_STATE_DEAD 1
#define EN_STATE_SPAWNING 2

// Vertical engine type for side_view

#define ENGINE_TYPE_JUMP 0
#define ENGINE_TYPE_JET_PAC 1
#define ENGINE_TYPE_SWIM 2
#define ENGINE_TYPE_AUTO_JUMP 3
13 changes: 10 additions & 3 deletions examples/07_cheril_perils_classic/dev/engine/cocos.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@ void cocos_init (void) {
void cocos_shoot_aimed (void) {
rdct = distance ();

if (rdct > COCO_FAIR_D && coco_slots_i) {
#ifdef COCO_FAIR_D
if (rdct > COCO_FAIR_D && coco_slots_i)
#else
if (coco_slots_i)
#endif
{
-- coco_slots_i; coco_it = coco_slots [coco_slots_i];

coco_x [coco_it] = rdx << 6;
Expand Down Expand Up @@ -86,13 +91,15 @@ void cocos_do (void) {
#endif

// Collide w/player
if (pstate == EST_NORMAL &&
if (pflickering == 0 &&
rdx + 7 >= prx &&
rdx <= prx + 7 &&
rdy + 7 + PLAYER_COLLISION_VSTRETCH_FG >= pry &&
rdy <= pry + 12
) {
pkill = 1;
en_sg_2 = 1;
#include "my/on_player_coco.h"
pkill = !!en_sg_2;
cocos_destroy ();
}
}
Expand Down
Loading

0 comments on commit 88ee89d

Please sign in to comment.