Raydium 3D Game Engine

Official forum for everything about Raydium, ManiaDrive, MeMak, ...
It is currently Tue Oct 15, 2024 7:01 pm

All times are UTC




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Fri Dec 24, 2010 7:26 pm 
Offline

Joined: Wed May 06, 2009 2:06 pm
Posts: 30
Hi, I have seen Mania Drive is a little bit difficult for children. I made couple of modifications to test is game then funnier to children. Patch is also for starting discussion about 'kidsmode' / trainer / cheat-mode...

a) all story-tracks are always playable
b) Acceleration and top-speed can be tuned before start track

I didn't find what file can be attachment, so here it is:
--- mania_drive_orig.c 2010-12-22 12:53:29.000000000 +0200
+++ mania_drive.c 2010-12-22 22:46:27.000000000 +0200
@@ -39,6 +39,11 @@

#define MAX_PROPS 100

+//Some globals for 'kids-mode'
+float car_top_speed= 165;
+float car_acceleration= 0.12;
+
+
GLfloat sun[]={1.0,0.9,0.5,1.0};
GLfloat amb[]={1.0,0.0,0.0,1.0};
GLfloat tmp2[]={1.0,1.0,1.0,1.0};
@@ -547,6 +552,11 @@

void btnDriveSolo(raydium_gui_Object *w)
{
+//For 'kids-mode'
+char str[RAYDIUM_MAX_NAME_LEN]; // useless
+car_top_speed=raydium_gui_read_name("menu","trkCarSpeed",str);
+car_acceleration=raydium_gui_read_name("menu","trkCarAccel",str) / 100.0 ;
+
drive(w->name);
mode=MODE_SOLO;
}
@@ -1070,7 +1080,9 @@
raydium_parser_cut(ret+last,part1,part2,';');
raydium_gui_widget_sizes(10,4,12);
candrive=(part2[1]!='4');
- raydium_gui_button_create(part1,handle,x1,pos,(candrive?gettext("Drive"):gettext("-")),(candrive?btnDriveSolo:btnCantDrive));
+ //raydium_gui_button_create(part1,handle,x1,pos,(candrive?gettext("Drive"):gettext("-")),(candrive?btnDriveSolo:btnCantDrive));
+ //'Kids-mode2' All tracks can be played in any order
+ raydium_gui_button_create(part1,handle,x1,pos,gettext("Drive"),btnDriveSolo);

part1[0]='*'+id; // avoid name collision
strcpy(part3,part2);
@@ -1103,6 +1115,9 @@

completed=build_gui_Story_sub(handle,STORY_FILE_BEG,2, 33,0);

+//'Kids-mode3' - Pro can be played even beginner is not passed
+/*
+#ifdef completed_demo
if(completed)
{
raydium_gui_widget_sizes(0,0,16);
@@ -1112,6 +1127,20 @@
raydium_gui_window_OnDelete_name("menu",video_beg_delete);
raydium_gui_label_create("lblOkBeg",handle,27,45,gettext("Beginners mode completed !"),0,0,0);
}
+#endif
+*/
+
+//'Kids-mode' - Sliders for tune Accel and max-speed
+raydium_gui_label_create("lblStats",handle,28,48,gettext("Stats"),0.3,0,0);
+raydium_gui_widget_sizes(0,0,18);
+raydium_gui_label_create("LblSpeed",handle,28,40,gettext("Max speed:"),0,0,0);
+raydium_gui_widget_sizes(20,2,0);
+raydium_gui_track_create("trkCarSpeed",handle,28,32, 10,1000,car_top_speed);
+raydium_gui_widget_sizes(0,0,18);
+raydium_gui_label_create("LblAccel",handle,28,28,gettext("Accel:"),0,0,0);
+raydium_gui_widget_sizes(20,2,0);
+raydium_gui_track_create("trkCarAccel",handle,28,20, 0,90,car_acceleration*100);
+//

completed=build_gui_Story_sub(handle,STORY_FILE_PRO,52,83,1);

@@ -1123,6 +1152,9 @@

gui_start();

+//'Kids-mode3' - 'Do not ever show completed'
+/*
+#ifdef all_maps_completed_demo
if(completed && !congrats)
{
congrats=1;
@@ -1130,6 +1162,8 @@
raydium_log("Completed !");
build_gui_StoryCompleted();
}
+#endif
+*/
}


@@ -2407,19 +2441,24 @@
if(game_state==GAME_END)
raydium_joy_y=raydium_joy_x=0;
speed=0;
-accel=0.12;
+//accel=0.12;
+//'Kids-mode'
+accel=car_acceleration;

if(raydium_joy_y>0.3)
{
- speed=raydium_joy_y*55;
+ //speed=raydium_joy_y*55;
+ speed=raydium_joy_y*car_top_speed; //default=55 //150=450kmh
raydium_ode_motor_power_max_name("moteur",accel);
raydium_particle_generator_enable_name("corps",1);
}
else
if(raydium_joy_y<0.3)
{
- speed=raydium_joy_y*5;
- raydium_ode_motor_power_max_name("moteur",0.2 * -raydium_joy_y);
+ //speed=raydium_joy_y*5;
+ //raydium_ode_motor_power_max_name("moteur",0.2 * -raydium_joy_y);
+ speed=raydium_joy_y*car_top_speed/10; //Reversing speed is one tenth
+ raydium_ode_motor_power_max_name("moteur",car_acceleration/6 * -raydium_joy_y); //Reversing accel is one of sixth
raydium_particle_generator_enable_name("corps",0);
}
else


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group