Posted By
|
Message
|
jamesh
Registered 28/02/2012 15:24:25
Points 381
|
4th March, 2012 at 04/03/2012 13:42:44 -
Hi
I'm trying to create a random map generator (using TGF2), but I've run into a problem when trying to use a frame size larger than the screen size.
What I'm doing essentially is running a fastloop that moves an active object, adding a backdrop copy every time it moves. This is fine on a smaller frame size, but when scrolling in involved, the image is not actually pasted beyond a certain point (though the non-obstacle property of it is - it's like there's an invisible non-backdrop object there.)
Does anyone know how to add backdrops which are visible, even when they're added away from the visible frame?
James
FWIW, here's my code:
Start of frame >
Set Global Value A to to Frame Width/2
Set Global Value B to 124
(Landgen object, which is a 32*16 Diamond)
Set X pos to Glob Val A
Set Y pos to Glob Val B
On Loop "G" >
(Langen Object)
Add Backdrop (Not an obstacle)
Set X pos to X(Landgen)-16
Set Y pos to Y(Landgen)+8
On Loop "G1" >
Start Loop "G" 40 times
Add 16 to Glob Val A
Add 8 to Glob Val B
(Landgen object)
Set X pos to Glob Val A
Set Y pos to Glob Val B
On pressing "Space Bar" >
Start Loop "G1" 40 times"
Edited by jamesh
n/a
|
blubblub
Registered 29/02/2012 23:35:38
Points 14
|
4th March, 2012 at 04/03/2012 13:52:00 -
Did you increase the max objects number in the frame properties?
Frame -> Runtime options -> Number of objects
n/a
|
jamesh
Registered 28/02/2012 15:24:25
Points 381
|
4th March, 2012 at 04/03/2012 13:57:49 -
I'll try that. However, surely there should only actually be one object at any given time? (2 counting the active that I'm using for scrolling) Or maybe fastloops don't work like that.
n/a
|
jamesh
Registered 28/02/2012 15:24:25
Points 381
|
4th March, 2012 at 04/03/2012 14:00:50 -
No, you're right, that works like a dream! Thanks a lot.
n/a
|
blubblub
Registered 29/02/2012 23:35:38
Points 14
|
4th March, 2012 at 04/03/2012 14:04:53 -
Yay. I could help someone.\o/
n/a
|
The_Antisony At least I'm not Circy
Registered 01/07/2002
Points 1341
|
5th March, 2012 at 05/03/2012 20:37:10 -
@Jamesh: When you paste a background object, it actually does create a new background object. Since MMF2 & TGF2 are limited to 500 objects per frame (accounting for all your other backgrounds and actives) when it hits 500, your active will stop pasting into the background. There are work-arounds like pasting to the background as a slowloop that would limit the number of new background objects, but you wouldn't get the same visual effect.
Edited by The_Antisony
ChrisD> Employer: Say, wanna see a magic trick?
ChrisD> Employee: Uhh… sure, boss.
ChrisD> Employer: Your job! It just disappeared! Pack your things and leave! Pretty good trick, huh?
|
jamesh
Registered 28/02/2012 15:24:25
Points 381
|
5th March, 2012 at 05/03/2012 20:40:29 -
Ah, I guess I assumed that the object limit only included actives. Thanks.
n/a
|
|
|