Graphics

Reply
Accepted Solution

GameEngine2D help

Before being introduced to GameEngine2d, I would say that I never really used someone elses engine. I usually had my game loop, which held a clear(),  update() and draw() functions. By doing this I knew exactly how to update my objects and so forth. So for my current issue. I am attempting to create a tile based game or background if you will. I have created a class called Map that subclasses SpriteList. I call a method on the Map object to read in a texture, setup the tiles with the correct size and position, Every tile is a sprite and stored in the SpriteList. I then add this to the scene. Once I do that I get the background as I want it, which is great however I am now attempting to move the map so to speak and cannot figure out the best way to do so. I have created a moveX function on the Map object and in return updates the Map.x value (checked with Console.WriteLine()). So in my while loop i check gamepad to see if the left or right button has been pressed and if so I am updating Map.moveX( some int ). My problem is the sprites in the list are obvisouly not being updated with the new x coordinate. 

 

What I would like to know from others that have been creating games for a while is:

 

Am I ok with subclassing the SpriteList?

 

If so, is it just overriding Update() and iterating through the list of sprites and updating the coordinates?

 

If not, what kind of approch is standard for this? Any places on the web that you can direct me too? I am self motivated so you kick me in the correct direction and I will be on my way. 

 

Any help is appreciated,

 

Mike

Please use plain text.

Re: GameEngine2D help

Deriving from SpriteList and providing an implementation of Update looks like it should work. Depending on the kind of game you're building you might want to use the Update method on the individual sprites (it looks like if you derive from SpriteBase you can provide your own per-sprite Update method). Note that it looks like you may need to call ScheduleUpdate to actually get Update called at the appropriate times.

Please use plain text.
This widget could not be displayed.
Announcements

Welcome to the PlayStation Mobile Developer Forums


This is a community for the discussion of technical topics with other developers and SCE engineers. Posting ideas/requests are also appreciated. Join the discussion!

PlayStation®Mobile開発者フォーラムでは世界中の開発者の皆様と一緒に、議論や情報交換が可能です。SCEも議論に参加し、皆様の開発をサポートします。アイデアやリクエストも大歓迎です。ぜひご参加ください。

PSM Developer Registration (for free) on PSM DevPortal is required to post on the forum.
Please sign out then sign in again to the forum and PSM DevPortal after you have completed the registration.

フォーラムへ投稿をするにはPSM DevPortalへの登録(無料)が必要です。
登録後はフォーラムと PSM DevPortalを一度ログアウトし、再度ログインしてください。






Recent News