PDA

View Full Version : Game Level Editor in 1.41


Mike Halliday
12-20-2007, 06:57 PM
Now that 1.41 has been released and the updates to the Game Level Editor is available I have a question or two...

How do I detect button/key presses? I have tried using the same code as in the Game API but the screen still does not move.

if (KeysPressed$[keys.vkLeft$])
SetOriginX(OriginX - 1);
AddSpriteOption(hero$, SO_MIRRORX);
SetSpriteFrames(hero$, 1, 3, -1, false);
end;

This is in the On_Timer function of the GAME sprite

What is the difference between the GAME sprite (The one that is already present in a new level) and adding a WORLD sprite?
(Is this where I am going wrong?)

What is the sprite limit in the Game Level Editor? My 3d ISO test (as posted before) has almost 100 sprites displayed in the editor and it is slow - Is there another way to do level creation?

Is there somewhere I can change the Level Editor to ISO mode like i can before calling the GAME API? - Would this help in sprite placement and detection?

Sorry for so many questions before the holidays but I really want to get to grips with the level editor.

Cheers

M.

kornalius
12-20-2007, 07:10 PM
In OnTimer, do the same you did in the WM_TIMER of a normal game, it should work.

A world sprite is simply a sprite that will be displayed but never be processed by the engine, it cannot have events, cannot move automatically, no collision, etc...

The game level editor has never been tried with 100 sprites. I don't know the limit, I should be doing some tests I guess. The same should be true with the visual form builder, 100 controls should be slow then.

The game level editor doesn't support ISO rendering, sorry, I don't have plans for it until version 2.0.

Mike Halliday
12-20-2007, 07:42 PM
Thanks for the speedy reply.

In the game sprite On_Timer the key pressses dont seem to move the screen origin at all. I have even tried it on a sprite and the sprite does not move either.

I guess I am doing something wrong! - Will have another go tomorrow when I have a clear head. - Any results I get I will post here! :)

PS: ISO support is worthy of V2 so I will have to wait for it! hee hee

Mike Halliday
12-20-2007, 08:02 PM
Have now put a G_Showmessage() in the ON_TIMER for a sprite in the bit of code above that was copied from the GAMEAPI code.

Nothing is displayed when I press left or right keys! :(

I MUST be missing something here??? But what I can't put my finger on!

kornalius
12-20-2007, 09:21 PM
Here is a fix.

1. Copy the attached file (unzipped) to c:\program files\ppl\
2. This will give you some more events (OnKeyDown, OnKeyUp, etc...) for the GAME component.
3. OnKeyDown:

* KeysPressed$[wParam$] = 1;

4. OnKeyUp:

* KeysPressed$[wParam$] = 0;

5. OnTimer:

* if (KeysPressed$[keys.vkUp$])
* end;

This will do what you want. [br]1198189266_1_FT8629_classes.zip

Mike Halliday
12-21-2007, 05:58 AM
Wow thanks Alain. That was such a quick response - You are a superhero after all.

I hope you and your family have a great holiday and I look forward to a good 2008 of PPL programming.

Cheers

Mike.

Mike Halliday
12-21-2007, 09:40 AM
Woo hoo - GAME Level Editor now responds to keypresses and events properly.

All i have to do is work out how to make a game now! hee hee

kornalius
12-21-2007, 11:41 AM
I just did a test with 90 sprites on screen (no transparency applied) and moving them around is normal speed. What is it that is slow exactly? Loading and saving the form will be slow by default because at load time it has to load the image file on each sprite, saving it has to generate the code file.

kornalius
12-21-2007, 12:55 PM
Ok, I have managed to find out the problem for the slowdown. It is now super fast compared to before. I have 160 sprites on screen and the speed of loading and everything else is just perfect.

Mike Halliday
12-21-2007, 01:06 PM
Well thats brill. - I have had a re-think about how to do the ISO rooms and have now cheated by having the floor the same in each room (its a bitmap) and just show the walls and objects. - Will there be an update after the holidays then?

Mike Halliday
12-21-2007, 01:12 PM
Any reason I get an access violation error when using G_TextOut in the Game Editor? - Is this function not available?

kornalius
12-21-2007, 02:55 PM
There will be a version 1.5 sometime in January.

Where do you put that G_TextOut(). It must be in WM_PAINT event (OnPaint) or between G_BeginScene and G_Update.

kornalius
12-21-2007, 03:28 PM
I have just changed my plans. There will be a version 1.42 which should be out mid-January. I have fixed quite a few problems with the Game Level Editor and Visual Form Editor regarding scroll bars.

Mike Halliday
12-21-2007, 07:41 PM
Yet again Alain, you surpass our expectations. Many thanks