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.
Show posts Menu
function repeatedly_execute_always() {
LabelHealth.Text=String.Format("%d",health); // to update label
if(IsTimerExpired(1)){
health -= 5; // takes 5 from health
SetTimer(1, 600); // updates counter health every 15 seconds (40 game loops= 40per sec x 15 =15 seconds. so 5 is
// taken off every 15 seconds.
}
}
QuoteSimply use the room-sized object made of a big black sprite.
SetNextScreenTransition(eTransitionInstant); // if you do not want any fade between the rooms.
CharName.ChangeRoom(1);// example. will keep x y from room 2 when you go back to room 1.
QuoteI think you should leave them nameless, or add a "mouse over" with the name instead.Due to the way the game is constructed having square mouse-overs is not really a viable option.
QuoteIt is however a bit difficult to see what is background and what are game elements.The main image is the background (BOARD). Game elements are: fairy and dragon cards (maybe add shadow for depth?), dragonfly, tumbler, wizard and hobbit and of course mouse hand.
//top of room script
bool roll=false;
bool throw=true;
#define SQUARE_COUNT 28
int currentSquare;
int squareX[SQUARE_COUNT];
int squareY[SQUARE_COUNT];
function room_Load()
{
currentSquare=1;
gStatusline.Clickable=false;
cGandolf.Clickable=false;
cGandolf.Baseline=0;
cHobbit.Loop=3;
game.speech_text_align=eAlignLeft;
oDice.SetView(6);
oDice.Animate(0, 4, eRepeat, eNoBlock);
}
void initBoard()
{
// From square 1
squareX[0] = 50; squareY[0] = 470;
squareX[1] = 50; squareY[1] = 379;
squareX[2] = 136; squareY[2]=368;
squareX[3] = 50; squareY[3] = 268;
squareX[4] = 50; squareY[4] = 173;
squareX[5] = 136; squareY[5] = 173;
squareX[6] = 225; squareY[6] = 173;
squareX[7] = 225; squareY[7] = 255;
squareX[8] = 314; squareY[8] = 173;
squareX[9] = 396; squareY[9] = 173;
squareX[10] = 485; squareY[10] = 173;
squareX[11] = 575; squareY[11] = 173;
squareX[12] = 575; squareY[12] = 237;
squareX[13] = 658; squareY[13] = 173;
squareX[14] = 744; squareY[14] = 173;
squareX[15] = 744; squareY[15] = 265;
squareX[16] = 744; squareY[16] = 355;
squareX[17] = 744; squareY[17] = 254;
squareX[18] = 744; squareY[18] = 371;
squareX[19] = 672; squareY[19] = 382;
squareX[20] = 678; squareY[20] = 457;
squareX[21] = 744; squareY[21] = 457;
squareX[22] = 586; squareY[22] = 457;
squareX[23] = 494; squareY[23] = 457;
squareX[24] = 494; squareY[24] = 438;
squareX[25] = 415; squareY[25] = 457;
squareX[26] = 322; squareY[26] = 457;
squareX[27] = 322; squareY[27] = 376;
squareX[28] = 278; squareY[28] = 376;
}
void movePlayer(int squaresToMove)
{
currentSquare = (currentSquare + squaresToMove) % SQUARE_COUNT;
player.Walk(squareX[currentSquare],squareY[currentSquare]);
}
String number[7];
void initNumbers()
{
number[0] = "zero";
number[1] = "one";
number[2] = "two";
number[3] = "three";
number[4] = "four";
number[5] = "five";
number[6] = "six";
}
function oTumbler_Interact()
{
int dieRoll = Random(5)+1;
if(roll==false && throw==true){
oTumbler.SetView(6);
oTumbler.Animate(1, 1, eRepeat, eNoBlock);
oDice.SetView(6);
oDice.Animate(0, 1, eRepeat, eNoBlock);
roll=true;
}
else if(roll==true && throw==true){
oDice.StopAnimating();
oTumbler.StopAnimating();
Wait(10);
oTumbler.Move(oTumbler.X, oTumbler.Y-40, 2, eBlock, eAnywhere);
Wait(20);
if(oDice.Frame ==0){
cGandolf.SayAt(cGandolf.x+9, cGandolf.y - 100, 500, String.Format("You have rolled a %s.", number[dieRoll]));
oTumbler.Move(oTumbler.X, oTumbler.Y+40, 2, eBlock, eAnywhere);
currentSquare = (currentSquare + oDice.Frame) % SQUARE_COUNT; // you might need to convert oDice.Frame to an integer?
cHobbit.Walk(squareX[currentSquare], squareY[currentSquare], eBlock, eAnywhere);
// etc etc through all the dice numbers
// It could be to do with the way i use odice frame to add event, possibly.....
cGandolf.SayAt(cGandolf.x+9, cGandolf.y -100, 500, String.Format("You have rolled a %s.", number[dieRoll]));
//FULL script
if(oDice.Frame ==0){
cGandolf.SayAt(cGandolf.x+9, cGandolf.y - 100, 500, String.Format("You have rolled a %s.", number[dieRoll]));
oTumbler.Move(oTumbler.X, oTumbler.Y+40, 2, eBlock, eAnywhere);
currentSquare = (currentSquare + dieRoll) % SQUARE_COUNT;
cHobbit.Walk(squareX[currentSquare], squareY[currentSquare]);
// Repeats for all dice numbers thrown
By continuing to use this site you agree to the use of cookies. Please visit this page to see exactly how we use these.
Page created in 0.406 seconds with 15 queries.