Wrap X & Y on a screen area that is actually smaller than the phone screen
Zombiebrains
www.zombiebrains.co.ukMember, PRO Posts: 296
Hi all
Quick question?
Can you in Gamesalad Wrap X/Y on a part of the game screen or will it only work on the whole screen.
I'm only asking as I have a graphic of an arcade machine over my main play area and the screen that the action appears is only x/y big so was wondering if my asteroid style game will work correctly if the visible game screen area can have the correct Warp x and Wrap y?
I currently have the whole iphone screen as wrap x and wrap y.
Thanks in advance
Quick question?
Can you in Gamesalad Wrap X/Y on a part of the game screen or will it only work on the whole screen.
I'm only asking as I have a graphic of an arcade machine over my main play area and the screen that the action appears is only x/y big so was wondering if my asteroid style game will work correctly if the visible game screen area can have the correct Warp x and Wrap y?
I currently have the whole iphone screen as wrap x and wrap y.
Thanks in advance
It takes a Zombie to know a Zombie!!!
Comments
Your always to my rescue!
lol how do i create a custom x & y behaviour?
It takes a Zombie to know a Zombie!!!
For example create separate attributes for left/right/up/down limits and set their values to your virtual screen borders, and if actors position x > right limit, change x position to left limit and vice versa, do the same for y axis and up/down limits...
There you go
I get the setting up the attributes for right, left,up & down...but how would it know say, if the ship went off screen at x position 300 it would know where to come in from the left...how would it know how high it was in the y axis?
It takes a Zombie to know a Zombie!!!
Thank you for your help as always
It takes a Zombie to know a Zombie!!!
Left limit: 768/2-512/2 = 128
Right limit: 768/2+512/2 = 640
Upper limit: 1024/2 + 512/2 = 768
Lower limit: 1024/2 -512/2 = 256
Rule: if self.positionX. > right limit
- change self.positionX to left limit
- change self.PositionY to 1024/2-(self.PositionY-512)
if your actor leaves screen at x: 640, y: 600 it will be moved to x: 128, y: 424
If it leaves at x: 640, y: 300 it returns at x: 128, y: 724
Adapt this for X< left limit and Y > upper limit and Y < lower limit
Personally, I like to use physical borders. For example I have four actors, labelled left, right, top, bottom.
These are placed outside the main screen, a little distance off from their respective edges.
In each 'enemy' I have the rules:
If you collide with right actor, move to the left side of the screen (coordinates).
If you collide with left actor, mover to right side of the screen (coordinates).
And so on.
The trick is to make sure when they hit an actor, not to place them so they immediately hit the opposite actor (which is why I place them a little away from the edges!)
My game, DotMatrixx uses this for the enemy movement/placing - it's free if you have a Mac: https://itunes.apple.com/gb/app/dotmatrixx/id481691880?mt=12
Hope that helps!
QS =D
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
That's great advice from both of you. I will try and get the game working now and it was bugging me as I've left the project alone for ages as just couldn't get the thing working properly.
Thank u both for your advice and time...
It takes a Zombie to know a Zombie!!!