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
0 registered members (), 16,232 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
Space Shooter Bounderies. #210224
06/09/08 04:50
06/09/08 04:50
Joined: May 2008
Posts: 73
Richmond, VA (USA)
coma_dose Offline OP
Junior Member
coma_dose  Offline OP
Junior Member

Joined: May 2008
Posts: 73
Richmond, VA (USA)
I am making a retro-style space shooter. The problem that I am having is that I am trying to keep the player ship from leaving the bounderies of the screen. The camera scrolls constantly forward, progressing the level, and the player moves with it. The camera is at a 45 degree angle downward giving some sort of forward visibility, I cannot use a physical border because I get odd bouncing behavior. I need a way to keep the player on screen.

Re: Space Shooter Bounderies. [Re: coma_dose] #210366
06/10/08 05:17
06/10/08 05:17
Joined: Apr 2006
Posts: 624
DEEP 13
badapple Offline
User
badapple  Offline
User

Joined: Apr 2006
Posts: 624
DEEP 13
well you can get your boundries in wed and use an if statment
in your movement code ... lets say your boundries are -1000 and
1000

if(player.x<1000)
{player_movent.x + = 10*(key_a)*time;
}
if(player.x>-1000)
{player_movent.x - = 10*(key_d)*time;
}


someting like that

Re: Space Shooter Bounderies. [Re: badapple] #210370
06/10/08 06:12
06/10/08 06:12
Joined: May 2008
Posts: 73
Richmond, VA (USA)
coma_dose Offline OP
Junior Member
coma_dose  Offline OP
Junior Member

Joined: May 2008
Posts: 73
Richmond, VA (USA)
This is sort of a problem, the camera is at a 45 degree angle and the bounderies won't match since the border of the screen resembles a box with the top pinched. Also, since I am using the mouse (no key_force) this results in the player being stuck at the bounderies. This is why I used a physical barrier initially.

Re: Space Shooter Bounderies. [Re: coma_dose] #210415
06/10/08 13:33
06/10/08 13:33
Joined: Oct 2007
Posts: 116
S
sydan Offline
Member
sydan  Offline
Member
S

Joined: Oct 2007
Posts: 116
You could somehow write a piece of script to see if the ship is still visible, if not then it stops moving. You would have to use the vec_for_screen functions and it would be long and complex but...


For some reason, my ambition always seems to beat my ability.
Re: Space Shooter Bounderies. [Re: sydan] #210429
06/10/08 15:12
06/10/08 15:12
Joined: May 2008
Posts: 73
Richmond, VA (USA)
coma_dose Offline OP
Junior Member
coma_dose  Offline OP
Junior Member

Joined: May 2008
Posts: 73
Richmond, VA (USA)
Actually I thought of that, not so long and complex though. Originally, I thought it would be cool to make the player lose if the ship went off the screen, the problem with stopping the movement is that once the movement is stopped, it would cause problems with moving the ship back on the screen.


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