Mintoris Forum

Author Topic: Focusing a specific sprite  (Read 2333 times)

Novoitch

  • Jr. Member
  • **
  • Posts: 6
Focusing a specific sprite
« on: Jul 28, 2018, 10:28 AM »
Is there a way to center the view on a specific tile?
Or do we need to recalculate position of all other sprites exept the focused one?

Mintoris

  • Administrator
  • Full Member
  • *****
  • Posts: 57
Re: Focusing a specific sprite
« Reply #1 on: Jul 28, 2018, 04:36 PM »
We need a little more info on what you are doing.

Novoitch

  • Jr. Member
  • **
  • Posts: 6
Re: Focusing a specific sprite
« Reply #2 on: Jul 28, 2018, 10:01 PM »
It's just to know if it's possible to do some optimization by avoiding useless operations.

I will take the example of the mintoris game "Space" :
In this game, the player is always drawn at the same coordinates, the view is centered on this sprite.
When moving, it's in fact the entire scene that move, but not the player.

So my question is : "Is the player effectively have always the same x and y, and so this is the positions of other sprites that are updated each tick. Or is there a way (a command i missed, for example,…) to move an entire scene/layer exepted (or not) a specific sprite"

I already looked for a command like this in the reference, but didn't find anything.

Mintoris

  • Administrator
  • Full Member
  • *****
  • Posts: 57
Re: Focusing a specific sprite
« Reply #3 on: Jul 29, 2018, 01:24 AM »
Hmm, had to dig into the code for this answer. There are features of the game engine that have not been implemented in Basic yet. When I get back around to the game engine, everything is going to change into something much easier. I've had a couple years to think of ways to simplify things. Anyway, one of the unimplemented features is a gravity well setting on a sprite. You can have up to 4 gravity wells in a scene at once. You have to tell all the objects affected by gravity which sprite is the gravity well. After that those sprites will fall towards the gravity well. I think that you can change the gravitational strength of the "gravity well sprite" by setting it's mass. I will be adding this feature after the version 8 upgrade is complete. There is also a formula for putting a sprite in orbit around a gravity well.

In the mean time you might consider adding sprite modifier subs to each sprite so they fall towards a single sprite. This is a fairly efficient way to modify the movement of groups of sprites. It would basically do the same thing as the gravity well feature.
« Last Edit: Jul 29, 2018, 01:34 AM by Mintoris »

TonyaCon

  • Full Member
  • ***
  • Posts: 19
Focusing a specific sprite
« Reply #4 on: Oct 19, 2019, 03:33 AM »
WOW I think your new background and sprite is a big improvment over the original

What game are you making? Original or remake?

Keep up the good work

Evelynwed

  • Full Member
  • ***
  • Posts: 26
Focusing a specific sprite
« Reply #5 on: Oct 21, 2019, 03:31 PM »
I think look into ways you can get the information for #tiereffect early enough that you can use xExtraLev.  The same way you can look up #levelcounta class earlier than you can get the cTotalLev on a class or the xTotalLev on a class special, see if theres an alternative way to get the information you need, early enough to be useful.

CarolclOry

  • Full Member
  • ***
  • Posts: 13
Focusing a specific sprite
« Reply #6 on: Oct 23, 2019, 02:03 AM »
Replace summoner with whichever other class this is being used for, if youre checking for something else.  And note that for summoner, theres going to be separate Classes tags for the APG version and the Unchained version.