Do frames always start in the upper left corner?
I've been puttering around with making a platform game for a while now, and I've created a few doors that switch frames when the player uses them. I've added "At start of frame" commands to immediately center the screen on the player when new frames start, but somehow the upper left hand corner of a frame always displays for an instant before jumping to player. Like a half-second flash of a different location before displaying on the player and the door they just came through. Is there some obvious mistake I'm making here? Any help is greatly appreciated!
Re: Do frames always start in the upper left corner?
That has to do with order of events. Events where those objects are placed aren't being executed until a couple milliseconds into the frame. Moving these events up or duplicating them to the top should fix that.
Re: Do frames always start in the upper left corne
Thanks, for the advice, but that that doesn't seem to be the problem. As of your comment I've moved all the "start of frame" commands to be the first commands executed, and still I get this flash of the upper left corner before the screen correctly centers on the player.
If I use the fade-in transition from the frame's properties menu, the screen faded-in on will an image of the upper left corner with the correct player-centered screen pasted over it. I'll see the player sprite, the door he came entered the frame through, and any other tiles from where the screen OUGHT to be centered, but this is all ON TOP OF an image of the upper left corner. When the fade-in transition ends, the image of the upper left corner will vanish and only the player centered screen remains.
If you've got any further thoughts I'd be glad to hear them. Thanks!
Re: Do frames always start in the upper left corne
When you create the object, make it invisible, then set its position, then make it visible. You can change the order of actions in the event list editor by clicking the number to the left of a condition.
Re: Do frames always start in the upper left corne
I may have a clue, I think:
http://www.clickteam.com/epicenter/ubbthreads.php?ubb=showflat&Number=76842
Re: Do frames always start in the upper left corne
I'd like to know also if there is a way to fix that... :)
Re: Do frames always start in the upper left corne
Usually when I add a fade in transition and I have the camera centered in a 'start of frame' event, it works for me, if I remember rightly :S
Is it the absolute first action in the whole event list? Does your player object have "create before fade in transition" enabled?
Re: Do frames always start in the upper left corne
Where is the "create before fade in tranisition" option? I just see a box checked for "create at start" in the player object's properties.
Re: Do frames always start in the upper left corne
OliverPearl's link looks like the exact same problem I'm having. Any ideas on how to fix this and still use objects in layer two?
Re: Do frames always start in the upper left corne
All red colored events are executed first by MMF no matter where they are in your event list. So
[color:#CC0000]Start of Frame[/color]
[color:#CC0000]Collision between[/color]
[color:#CC0000]Never[/color]
[color:#CC0000]Animation is over[/color]
[color:#CC0000]Number of Lives Reaches 0[/color]
And a few others also. These all happen before anything else in MMF no matter where they are in your event list.
Now you CAN negate the execution priority by placing another event over top of these, I.E. If those events are NOT the first events in a set of actions, they won't happen first, at that point they will happen where and whenever they appear in your event list.
[color:#009900]Now an idea for your problem, have you tried the command "Clear Screen"? At the start of your game? You get a color pallete to choose from, and that "might" give you a way to shroud the frame jump. I don't know if this will work, I'm just basing the idea on how it "seems" to work...
I've never actually tried this.[/color]
Re: Do frames always start in the upper left corne
Believe it or not, I never solved this problem!
It looks like if there's more than one layer in a game, and any upper layer has background objects in the upper left corner--the area traced out with a dotted line--those background objects will briefly flash at the start of the frame. Not the active objects, just the backgrounds.
Has anyone found a solution to this since the first time I inquired?
Re: Do frames always start in the upper left corne
I make my own transition using a solid black active object (with follow frame) so at the very start, all the player can see is blackness, then when I've positioned everything in the background I start making the black active fade away, then when it is invisible I destroy it and enable player inputs. FIXED!
Re: Do frames always start in the upper left corne
I had this problem, too. It does happen when you have more than 1 layer. I solved it by making the bottom layer invisible by default and turning it on at the start of the frame. Also, the frame background colour must be black (and you can change it to whatever colour you like after the start of the frame), or the game will flash whatever frame background you have set.
To be able to edit the level productively, I made a quick background object that repeats a blue 16x16 tile and locked it--this makes things a lot easier. It is in a layer below the obstacle layer of the frame, and it's also made invisible by default. You could alternatively delete this quick background when you're done building the frame.
Edit: I also have a manual fade in from black. MMF for some reason renders the first layer and the frame background before all the other layers.
Re: Do frames always start in the upper left corne
I used to use the method you've suggested, DaveC, only I used a white fade in instead back then.
Looks like making the offending layers invisible default and restoring them to visibility with a start of frame command solves this issue, Alonso. Thanks so much for the advice!
I also figured out that by putting my start of frame centering commands into the universal code instead of the frame code, the centering would occur before the fade in.