Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/20/24 01:28
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (kzhao, AndrewAMD, bigsmack), 824 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Creating panels in a loop #200842
04/05/08 20:18
04/05/08 20:18
Joined: Aug 2006
Posts: 652
Netherlands
bstudio Offline OP
User
bstudio  Offline OP
User

Joined: Aug 2006
Posts: 652
Netherlands
This is the code I use:
 Code:
PANEL* currentBrick;

void createBricks(int bricksNum){
	var i;
	for(i=0; i<bricksNum; i++){
		var newPos = i*40;
		PANEL* currentBrick = {
			pos_x = 0;
			pos_y = 0;
			bmap = "brick.tga";
		}
		set(currentBrick, VISIBLE);
	}
}


Is this even possible or do I need to create a seperate panel for each brick? apperantly I also cannot use a variable for the x position. It gives me the error: number syntax newPos

Last edited by bstudio; 04/05/08 20:19.

BASIC programmers never die, they GOSUB and don't RETURN.
Re: Creating panels in a loop [Re: bstudio] #200843
04/05/08 20:23
04/05/08 20:23
Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
check out the pan_create function


3333333333
Re: Creating panels in a loop [Re: Quad] #200844
04/05/08 20:24
04/05/08 20:24
Joined: Aug 2006
Posts: 652
Netherlands
bstudio Offline OP
User
bstudio  Offline OP
User

Joined: Aug 2006
Posts: 652
Netherlands
Ugh, to think I didn't find that in the manual. Thanks a lot.


BASIC programmers never die, they GOSUB and don't RETURN.

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

Gamestudio download | chip programmers | 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