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,449 guests, and 6 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
move in circlular or semi-circular #149325
08/21/07 10:12
08/21/07 10:12
Joined: Apr 2007
Posts: 83
prog Offline OP
Junior Member
prog  Offline OP
Junior Member

Joined: Apr 2007
Posts: 83
Using hslider the bmp is moving horizantally, but how can i move it in circular or semicircular motion with respect to time.

code:
-----

panel speed_factor
{
bmap = slider_pcx;
layer = 20;
pos_x = 10;
pos_y = 25;
hslider = 10, -12, 200, cursor_pcx, 0, 60, temp1;
flags = d3d, overlay, refresh;
}

////////////////////////////////////////////////////////////////

function init_timedemo()
{
speed_factor.visible = on;
WHILE (1)
{
IF (seconds > 0) // limit the health decrease
{

temp1 = seconds - 1 ;

}
else
{
time_txt.visible = off;
wait(3);
EXIT;
}

WAIT (1);
}

}

Re: move in circlular or semi-circular [Re: prog] #149326
08/21/07 10:36
08/21/07 10:36
Joined: Mar 2005
Posts: 564
/www/europe/ germany/index.php
TSG_Torsten Offline

User
TSG_Torsten  Offline

User

Joined: Mar 2005
Posts: 564
/www/europe/ germany/index.php
Maybe you've to try panel.angle and panel.center_x/panel.center_y.

while(1)
{
my_panel.angle+=5*time_step;
my_panel.center_x = my_panel.size_x * 0.5;
my_panel.center_y = my_panel.size_y * 0.5;
wait(1);
}

Regards
TSGames

Re: move in circlular or semi-circular [Re: TSG_Torsten] #149327
08/21/07 11:47
08/21/07 11:47
Joined: Apr 2007
Posts: 83
prog Offline OP
Junior Member
prog  Offline OP
Junior Member

Joined: Apr 2007
Posts: 83
thanks,
but my problem is not yet solved.
i want it to move on a circle(circular movement), but it is paning(rotating) in the same position.

Re: move in circlular or semi-circular [Re: prog] #149328
08/21/07 12:16
08/21/07 12:16
Joined: Mar 2005
Posts: 564
/www/europe/ germany/index.php
TSG_Torsten Offline

User
TSG_Torsten  Offline

User

Joined: Mar 2005
Posts: 564
/www/europe/ germany/index.php
You should change the center_x and center_y parameters, this is the rotation center.

Regards
TSGames

Re: move in circlular or semi-circular [Re: TSG_Torsten] #149329
08/21/07 12:48
08/21/07 12:48
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Code:

var panel_radius[2] = 10,10; //if both values are equal: circle movement
var panel_pos[2]; //middle point of the circle on which the panel moves
var radius_speed = 10; //the speed of the movement
var status_panel;
var panel_angle;

panel my_panel
{
bmap = cursor_pcx;
layer = 20;
flags = d3d,overlay;
}

function move_panel()
{
while(status_panel)
{
my_panel.pos_x = panel_radius.x * cos(panel_angle);
my_panel.pos_y = panel_radius.y * sin(panel_angle);

panel_angle += radius_speed * time_step;
wait(1);
}
}

function stop_panel()
{
status_panel = 0;
}

function init_panel()
{
panel_pos.x = screen_size.x / 2;
panel_pos.y = screen_size.y / 2;
status_panel = 1;
move_panel();
}


Hope this helps a bit.


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