Getting white screen, not working

Jan 1, 2013 at 10:01pm
With knowledge from you guys about while and if statements i cleaned up my code to this.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
	 while (start < 2){
		 if (stage1 = true){
			 Drawitem(itemx,itemy,0,255,0 );}
		 if (!stage2){
			 Drawitem(item2x,item2y,0,255,0 );}
		 if (!stage3){
			 Drawitem(item3x,item3y,0,0,255 );
		 	 if (facex<400){item3x=item3x+4,item3y=item3y-4;}}

			 if (facex-5 <= item2x+5 && facex+5 >= item2x-5 && facey-5 <= item2y+5 && facey+5 >= item2y-5) {
				stage1=false,stage2=false;}
			 if (facex-5 <= item2x+5 && facex+5 >= item2x-5 && facey-5 <= item2y+5 && facey+5 >= item2y-5) {
				stage2=true,stage3=false;}
			 if (facex-5 <= item3x+5 && facex+5 >= item3x-5 && facey-5 <= item3y+5 && facey+5 >= item3y-5) {
				stage3=true;}
	 }

but now it whitescreens instead of working. Help idk what i did wrong.
Jan 1, 2013 at 10:04pm
line 2 is an assignment (=). You probably wanted comparison (==)
Jan 1, 2013 at 10:14pm
I changed it to
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
		 if (stage1== true){
			 Drawitem(itemx,itemy,0,255,0 );}
			 if (facex-5 <= item2x+5 && facex+5 >= item2x-5 && facey-5 <= item2y+5 && facey+5 >= item2y-5) {
				stage1=false,stage2=false;}

		 if (stage2==false){
			 Drawitem(item2x,item2y,0,255,0 );}
			 if (facex-5 <= item2x+5 && facex+5 >= item2x-5 && facey-5 <= item2y+5 && facey+5 >= item2y-5) {
				stage2=true,stage3=false;}

		 if (stage3==false){
			 Drawitem(item3x,item3y,0,0,255 );
		 	 if (facex<400){item3x=item3x+4,item3y=item3y-4;}}
				 if (facex-5 <= item3x+5 && facex+5 >= item3x-5 && facey-5 <= item3y+5 && facey+5 >= item3y-5) {
					stage3=true;}


but now it doesnt work properly with collision. Also if I add a while in there at all!!! it whitescreens
Jan 2, 2013 at 12:31am
You are not changing 'start' anywhere in that loop. So once the loop starts, it will continually loop forever because 'start' will always be less than 2.
Last edited on Jan 2, 2013 at 12:31am
Topic archived. No new replies allowed.