Skip to content

Commit

Permalink
trying to throw cards
Browse files Browse the repository at this point in the history
  • Loading branch information
ericoporto committed Jan 27, 2019
1 parent 63e162c commit 5924ec2
Show file tree
Hide file tree
Showing 25 changed files with 552 additions and 18 deletions.
2 changes: 1 addition & 1 deletion DEFINESSS.ash
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// new module header
#define TRASH 3
#define TRASH 6
#define GAMEW 224
#define GAMEH 320
326 changes: 322 additions & 4 deletions Game.agf

Large diffs are not rendered by default.

33 changes: 33 additions & 0 deletions Gameatic.asc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Timer * t_killMember;
Timer * t_enemy2[50]; //time throwing
Timer * t_enemy2_whenToStartThrow[50]; //this number is only big enough to not crash
Timer * t_enemy2_throw[50]; //this number is only big enough to not crash
bool enemy2_didthrow[50]; //time throwing

int destination_left;
int destination_right;
Expand Down Expand Up @@ -221,6 +222,10 @@ void DoChompOrHit(Character * enemy){
}

void dealWithEnemy1(Character * enemy1){
if(enemy1.Room != player.Room){
return;
}

if(enemy1.DestinationX == destination_left && enemy1.Moving){

} else if(enemy1.DestinationX == destination_right && enemy1.Moving){
Expand All @@ -238,6 +243,28 @@ void dealWithEnemy1(Character * enemy1){

// enemy walks around and occasionally pauses to throw letters
void dealWithEnemy2(Character * enemy2){
if(enemy2.Room != player.Room){
return;
}


if(enemy2.View == ENEMY2THROW){
if(enemy2.Frame == 2){
if(!enemy2_didthrow[enemy2.ID]){
if( enemy2.Loop == 2){
ThrowLetter(enemy2.x, enemy2.y, eDirectionRight);
} else {
ThrowLetter(enemy2.x, enemy2.y, eDirectionLeft);
}
}

enemy2_didthrow[enemy2.ID] = true;
} else {
enemy2_didthrow[enemy2.ID] = false;
}
}


if(t_enemy2_whenToStartThrow[enemy2.ID] != null && t_enemy2_whenToStartThrow[enemy2.ID].EvtExpired){
t_enemy2_whenToStartThrow[enemy2.ID] = null;

Expand Down Expand Up @@ -314,4 +341,10 @@ void repeatedly_execute(){
gArms2.UnlockView();

}
}

void on_event (EventType event, int data){
if(event == eEventLeaveRoom){
resetBonePile();
}
}
63 changes: 50 additions & 13 deletions LetterController.asc
Original file line number Diff line number Diff line change
@@ -1,26 +1,63 @@
// new module script
#define NLETTERS 8

Character * ar_letter[NLETTERS];

void shouldLetterBeTrashed(Character * cALetter){
if(cALetter.Room == player.Room && (cALetter.x < 0 || cALetter.x > GAMEW || cALetter.y < 0 || cALetter.y > GAMEH)){
cALetter.ChangeRoom(TRASH);
}
}

void game_start(){
ar_letter[0] = cLetter1;
ar_letter[1] = cLetter2;
ar_letter[2] = cLetter3;
ar_letter[3] = cLetter4;
ar_letter[4] = cLetter5;
ar_letter[5] = cLetter6;
ar_letter[6] = cLetter7;
ar_letter[7] = cLetter8;
}

void ThrowLetter(int x, int y, CharacterDirection direction){
if(direction == eDirectionLeft){
Character * LetterChar;

int i=0;
while(i<NLETTERS){
if(ar_letter[i].Room == TRASH){
if(direction == eDirectionRight){
ar_letter[i].ChangeRoom(player.Room, x+8, y);
} else {
ar_letter[i].ChangeRoom(player.Room, x-8, y);
}
LetterChar = ar_letter[i];
break;
}
i++;
}

LetterChar.Animate(0, 2, eRepeat, eNoBlock, eForwards);
if(direction == eDirectionLeft){
LetterChar.TweenX(1.2, x-GAMEW, eEaseLinearTween, eNoBlockTween);
LetterChar.TweenY(0.3, y-40, eEaseOutExpoTween, eNoBlockTween);
LetterChar.TweenY(0.7, y+40, eEaseLinearTween, eNoBlockTween, 0.3);
} else {
// must be right

LetterChar.TweenX(1.2, x+GAMEW, eEaseLinearTween, eNoBlockTween);
LetterChar.TweenY(0.3, y-40, eEaseOutExpoTween, eNoBlockTween);
LetterChar.TweenY(0.7, y+40, eEaseLinearTween, eNoBlockTween, 0.3);
}

}



void repeatedly_execute_always(){
if(cLetter1.Room == player.Room && (cLetter1.x < 0 || cLetter1.x > GAMEW || cLetter1.y < 0 || cLetter1.y > GAMEH)){
cLetter1.ChangeRoom(TRASH);
}
if(cLetter2.Room == player.Room && (cLetter2.x < 0 || cLetter2.x > GAMEW || cLetter2.y < 0 || cLetter2.y > GAMEH)){
cLetter2.ChangeRoom(TRASH);
}
if(cLetter3.Room == player.Room && (cLetter3.x < 0 || cLetter3.x > GAMEW || cLetter3.y < 0 || cLetter3.y > GAMEH)){
cLetter3.ChangeRoom(TRASH);
}
if(cLetter4.Room == player.Room && (cLetter4.x < 0 || cLetter4.x > GAMEW || cLetter4.y < 0 || cLetter4.y > GAMEH)){
cLetter4.ChangeRoom(TRASH);
int i=0;
while(i<NLETTERS){
shouldLetterBeTrashed(ar_letter[i]);
i++;
}

}
1 change: 1 addition & 0 deletions LetterController.ash
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
// new module header
import void ThrowLetter(int x, int y, CharacterDirection direction);
Binary file modified acsprset.spr
Binary file not shown.
Binary file added img/bone/bone_00.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/bone/bone_01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified img/level2/bg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified img/level3/bg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/level4/bg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/level5/bg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions room1.asc
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,8 @@ function room_Leave()
{
FakeScreen.Disable();
}

function room_Load()
{
cBonePile.ChangeRoom(1, 21, 285);
}
Binary file modified room1.crm
Binary file not shown.
5 changes: 5 additions & 0 deletions room2.asc
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,9 @@ function room_AfterFadeIn()
function room_Leave()
{
FakeScreen.Disable();
}

function room_Load()
{
cBonePile.ChangeRoom(2, 21, 285);
}
Binary file modified room2.crm
Binary file not shown.
44 changes: 44 additions & 0 deletions room3.asc
Original file line number Diff line number Diff line change
@@ -1 +1,45 @@
// room script file
function room_LeaveLeft()
{
doLeaveLeft();
}


function room_LeaveRight()
{
doLeaveRight();
}


function room_LeaveTop()
{

}


function room_RepExec()
{
//dealWithEnemy1(cEnemy1_0);
//dealWithEnemy1(cEnemy1_1);
// dealWithEnemy1(cEnemy1_2);
checkBonePileRepExe();

}

function room_AfterFadeIn()
{
// init_enemy1(cEnemy1_0);
// init_enemy1(cEnemy1_1);
// init_enemy1(cEnemy1_2);
FakeScreen.Enable();
}

function room_Leave()
{
FakeScreen.Disable();
}

function room_Load()
{
cBonePile.ChangeRoom(3, 21, 285);
}
Binary file modified room3.crm
Binary file not shown.
45 changes: 45 additions & 0 deletions room4.asc
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// room script file
function room_LeaveLeft()
{
doLeaveLeft();
}


function room_LeaveRight()
{
doLeaveRight();
}


function room_LeaveTop()
{

}


function room_RepExec()
{
//dealWithEnemy1(cEnemy1_0);
//dealWithEnemy1(cEnemy1_1);
// dealWithEnemy1(cEnemy1_2);
checkBonePileRepExe();

}

function room_AfterFadeIn()
{
// init_enemy1(cEnemy1_0);
//init_enemy1(cEnemy1_1);
// init_enemy1(cEnemy1_2);
FakeScreen.Enable();
}

function room_Leave()
{
FakeScreen.Disable();
}

function room_Load()
{
cBonePile.ChangeRoom(4, 21, 285);
}
Binary file added room4.crm
Binary file not shown.
45 changes: 45 additions & 0 deletions room5.asc
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// room script file
function room_LeaveLeft()
{
doLeaveLeft();
}


function room_LeaveRight()
{
doLeaveRight();
}


function room_LeaveTop()
{

}


function room_RepExec()
{
//dealWithEnemy1(cEnemy1_0);
//dealWithEnemy1(cEnemy1_1);
// dealWithEnemy1(cEnemy1_2);
checkBonePileRepExe();

}

function room_AfterFadeIn()
{
//init_enemy1(cEnemy1_0);
//init_enemy1(cEnemy1_1);
//init_enemy1(cEnemy1_2);
FakeScreen.Enable();
}

function room_Leave()
{
FakeScreen.Disable();
}

function room_Load()
{
cBonePile.ChangeRoom(5, 21, 285);
}
Binary file added room5.crm
Binary file not shown.
1 change: 1 addition & 0 deletions room6.asc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// room script file
Binary file added room6.crm
Binary file not shown.
Binary file modified sprindex.dat
Binary file not shown.

0 comments on commit 5924ec2

Please sign in to comment.