Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 18,633 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
A few simple questions #187725
03/09/08 19:28
03/09/08 19:28
Joined: Mar 2008
Posts: 23
J
jmasterx Offline OP
Newbie
jmasterx  Offline OP
Newbie
J

Joined: Mar 2008
Posts: 23
Hello,

I've recently started making my own little sphere-game after completing most of the lite-c tutorials but i'm a bit unclear about a couple things. The first thing is that by ball jumps, but unfortunatly it goes very high, In a normal game, you press jump as much as you want but it will ignor all other jumps untill your back on ground but mine are cumilitive and never stop, how could I make it stop? the function is this:

// This is our event function for hitting the [Space] key.
function Kick()
{
// Create a speed vector and rotate it in camera direction.
vKick.x = 0; vKick.y = 0; vKick.z = 0;


// Add a vertical speed to give the ball an upwards kick.
vKick.z = 300;

// Now apply the speed to the ball, and play a hit sound.
phent_addvelcentral(ball,vKick);
Plop();
wait (-2);
}

------------------------------------------------------------------------------

My next question is once my ball gets to the end of the course I have a doorway with a black box, I dont need anything fancy, I just want it so that when the back hits the door (collides with it) a new "loading" screen comes on and a few seconds later I get a new level, because right now my entire second level is in another .c file with a main functions and others like the first one, so basicly ide like it to run my second .c file like it was my first (unless there is an easier way)

-------------------------------------------------------------------------------
My last question isw optional but would be nice to have... Right now my camera is set to stay consistantly 300 feet from my ball... the script is :

camera.x = ball.x - 600; // keep the camera 300 quants behind the ball
camera.y = ball.y; // using the same y with the ball
camera.z = ball.z + 300; // and place it at z = 1000 quants
vForce.x = -5*(mouse_force.x); // pan angle
vForce.y = 5*(mouse_force.y); // tilt angle
vForce.z = 0; // roll angle
vec_accelerate(vMove,vAngularSpeed,vForce,0.8);
vec_add(camera.pan,vMove);

unfortunatly that camera makes it feel like a 3d scroller game in the sence that when the ball turns left or right, the camera just moves, so basicly i'de like a follow cam/chase cam, I know there is a prefab one but I have no idea how to implement it...

Thank You,

JmasterX

Re: A few simple questions [Re: jmasterx] #187726
03/10/08 04:38
03/10/08 04:38
Joined: Apr 2004
Posts: 516
USA
Trooper119 Offline
User
Trooper119  Offline
User

Joined: Apr 2004
Posts: 516
USA
It looks like your emulating the earthball.c code in lite-c, in which case that code should help you solve any movement problems. As for ending your game, you should check your manual.

Your code can be taken directly from the manual, attach something like the following to your doorway.
Code:
 action exploding_barrel() 
{
my.ENABLE_IMPACT = ON; // sensible for push collision
my.emask |= ENABLE_IMPACT;
my.event = bounce_event;
...
}



Then have another function bounce_event that does what you want (end the game, ect.)

Code:
 function bounce_event()
{
if (event_type == EVENT_IMPACT)
{
ent_playsound(my,explode,50);
set(predefinedPanelOrBmap, VISIBLE);
//If you want more...
level_load("newLevel.wmb");
// Wait a second, then remove the panel/text.
wait(-1);
reset(predefinedPanelOrBmap, VISIBLE);
}
}



In retrospect you should probably attach the collision detection to the door that way the first time you hit a wall with the ball you don't set of the event and reset the level each time ;0


A clever person solves a problem.
A wise person avoids it.
--Einstein

Currently Codeing: Free Lite-C

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1