Jump to content

  • Log In with Google      Sign In   
  • Create Account

Dragonsoulj

Member Since 15 Jun 2006
Offline Last Active May 26 2016 02:44 AM

#5272969 Recommendations for a Text Editor

Posted by Dragonsoulj on 28 January 2016 - 04:40 AM

You can write plugins and such for Notepad++, and it uses Scintilla for syntax highlighting last I checked.




#5272968 Why didn't somebody tell me?

Posted by Dragonsoulj on 28 January 2016 - 04:38 AM

 


Drinking Fountain = Faucet that emits water upwards a few inches that lets you drink directly from the stream (or fill a bottle). Usually includes a basin to catch the water that you don't drink/bottle.

Until you get to Boston and they ironically call that a 'bubblah'. I gather parts of Massachusetts and Rhode Island use the term unironically.

 

 

Speaking of Boston:
wnd_fe800d389576dc455c193961cd7e7944.jpg




#5272806 Sprite Sheet Need Help

Posted by Dragonsoulj on 27 January 2016 - 01:51 AM

Alright, now I have a little time to do this.

 

Let's assume this is your sprite sheet, a simple 3 frame animation of a jump, animated from left to right:

SpriteSheet1.png

 

You set your sprite to use the sprite sheet but only to display a single frame at a time:

SetSpriteSize(player.spr,17.96875,-1)
SetSpriteImage(player.spr,PlayerImg[12])

SetSpriteAnimation(player.spr,230,201,5)

And on each frame you are animating it:

if GetSpriteExists(PBullet[a]) = 1
     if Player.fire = 1            

     SetSpritePositionByOffset(PBullet[a],GetSpriteXByOffset(PBullet[a])+1.0,GetSpriteYByOffset(PBullet[a]))

     elseif Player.fire = -1

         SetSpritePositionByOffset(PBullet[a],GetSpriteXByOffset(PBullet[a])-1.0,GetSpriteYByOffset(PBullet[a]))

     endif

endif

Which moves your animation in this direction:

SpriteSheet3.png

 

This seems to work. Everything goes well when the sprite is on the left. However, when you move to the opposite side, you do the following:

//Flip Player according to X Position


if Player.x > Enemy.x //mean The player on the right side of the screen

if PIsGround = 1 then SetSpriteFlip(Player.spr,1,0) 

else

if PIsGround = 1 then SetSpriteFlip(Player.spr,0,0)

endif

Which does this to the sprite sheet the sprite uses:

SpriteSheet2.png

 

This flipped your image, making your sprite face the proper direction, however, you are still offsetting the sprite in the same direction since your left side/right side conditional doesn't include the movement/animation offset. What this means is your animation still follows the frames as indicated:

SpriteSheet4.png

 

To fix this, you have two options.

 

Option 1 involves a left side/right side conditional check for the offset portion:

if GetSpriteExists(PBullet[a]) = 1
     if Player.fire = 1 
           if Player.x > Enemy.x
               SetSpritePositionByOffset(PBullet[a],GetSpriteXByOffset(PBullet[a])-1.0,GetSpriteYByOffset(PBullet[a])) // Inverted
          else

               SetSpritePositionByOffset(PBullet[a],GetSpriteXByOffset(PBullet[a])+1.0,GetSpriteYByOffset(PBullet[a])) // Original
           endif

     elseif Player.fire = -1
 

           if Player.x > Enemy.x
               SetSpritePositionByOffset(PBullet[a],GetSpriteXByOffset(PBullet[a])+1.0,GetSpriteYByOffset(PBullet[a]))  // Inverted
          else

               SetSpritePositionByOffset(PBullet[a],GetSpriteXByOffset(PBullet[a])-1.0,GetSpriteYByOffset(PBullet[a])) // Original
           endif

         

     endif

endif

Or something that takes into account the player's location.

 

Option 2 involves something a little more flexible and less code:

Add a player direction variable we use to make all adjustments to animations.

//Flip Player according to X Position
int PlayerDirection = 1 // Not sure what language, so however you declare an integer
if Player.x > Enemy.x //mean The player on the right side of the screen
PlayerDirection = -1

if PIsGround = 1 then SetSpriteFlip(Player.spr,1,0) 

else
PlayerDirection = 1

if PIsGround = 1 then SetSpriteFlip(Player.spr,0,0)

endif

Then use it.

if GetSpriteExists(PBullet[a]) = 1
     if Player.fire = 1            

     SetSpritePositionByOffset(PBullet[a],GetSpriteXByOffset(PBullet[a])+1.0*PlayerDirection,GetSpriteYByOffset(PBullet[a]))

     elseif Player.fire = -1

         SetSpritePositionByOffset(PBullet[a],GetSpriteXByOffset(PBullet[a])-1.0*PlayerDirection,GetSpriteYByOffset(PBullet[a]))
     endif

endif

With either option, you should have your sheet offsetting in the proper direction for the animation. In the case of the flipped sprite sheet:

SpriteSheet5.png




#5272761 Sprite Sheet Need Help

Posted by Dragonsoulj on 26 January 2016 - 03:55 PM

yes, the Player.spr is the whole sprite sheet
 

and when the player is on the opposite side (the right), move the sprite offset in the negative direction.

 
No, I used below commands for get current Offset but Player Offset at (right or left) are same.
Print(GetSpriteOffsetX(Player.spr))
Print(GetSpriteOffsetY(Player.spr))

What I mean is this: since you flipped the whole spritesheet, you must also flip the animation movement code. I will have to do a sprite mockup and source code sample for you when I get home tonight.


#5272667 When the Player and the CPU attacks at the same time

Posted by Dragonsoulj on 25 January 2016 - 10:17 PM

All of the enemies aren't the same size as the character. Also that is the functionality of blocking. would it be redudant to block by blocking and block by attacking too?


Since enemies vary in size, adjust knock back accordingly. Bigger enemies push the player back further than themselves, and in some cases, do not get pushed back by the player.


#5272501 Sprite Sheet Need Help

Posted by Dragonsoulj on 24 January 2016 - 01:57 PM


Note: I used several Tools (Sprite sheet generator, Sprite sheet Creator, Texture Packer, ... but all had same result.)

 

Given this bit of information, emphasis added, I would say Eck is right and it is in your code somewhere. I don't know how it handles the sprite sheet, but if I am right, the Player.spr is the whole sprite sheet. I would suggest taking what you have, and when the player is on the opposite side (the right), move the sprite offset in the negative direction. This would make all your sprites face the proper way (as you already have) and transition (animate) in the order you desire.




#5271818 C++

Posted by Dragonsoulj on 19 January 2016 - 04:01 AM


Personally, I'd get two books: One heavy one to heavy textbook to read when sitting at the computer, and one more "fun" reference book to flip through while relaxing on the couch. I'd then supplement that with online tutorials and articles and by asking specific questions on these forums. As you grow (say, after six months or more), I'd pick up two more abstract books like Code Complete 2nd Edition and Pragmatic Programmer. But I wouldn't get those until after you finish you first two books.

 

And then I look at the books sitting on my desk: The C++ Programming Language reference book from Stroustrup and Code Complete 2nd Edition. I guess this is sound advice. Haha!




#5271649 C# - glu32 DLL rferece?

Posted by Dragonsoulj on 17 January 2016 - 10:19 PM

All I've managed to find from Googling is:

[DLLImport "Glu32.dll"]



#5264945 Why didn't somebody tell me?

Posted by Dragonsoulj on 04 December 2015 - 05:13 PM

 


Why didn't somebody tell me that upgrading debian Linux via its gui upgrade tool can completely brick the system if you do a dist-upgrade?

Repeat after me: "dist-upgrade is never a safe operation"... That it sometimes succeeds should not be taken as an indication that you won't lose all your data the next time.

 

I don't know how many times I've bricked Ubuntu during major version upgrades. These days I just clean install instead.

 

 

Isn't dist-upgrade just updating the kernels and not Ubuntu itself? I could have sworn there was a separate command for that.




#5264832 Why didn't somebody tell me?

Posted by Dragonsoulj on 03 December 2015 - 10:41 PM

 

Did you know you can drag with the right mouse button and it will open a context menu with options when you drop?

 
This is new to me! I knew about the Shift+Drag and Ctrl+Drag, but I didn't know about right-click dragging.

 

I'm not sure if someone already mentioned it, but you can Shift+Right-Click empty space in Windows Explorer to open a command console at that location ("Open command window here"). I use that alot.

 

 

Shift-Right-Click does a good many things besides in Windows Explorer. For instance, if you are using Windows Vista+ and you miss the Minimize, Maximize, Restore, and Move options in your taskbar, you can find them if you Shift+Right-Click. Shift+Right-Clicking executables gives you the option to run as a different user, handy if you are logged in as a regular user and need to run as an admin account (especially in a domain environment).




#5264827 Why didn't somebody tell me?

Posted by Dragonsoulj on 03 December 2015 - 09:45 PM

 

Dragging items or selections in an explorer window? Hold a mod key to get more actions. CTRL will give you copy I believe, while SHIFT will give you move (may be switched, but for sure gives those options).

Did you know you can drag with the right mouse button and it will open a context menu with options when you drop?

 

 

That I did.

 

Anymore fun tips from anyone?




#5257422 Why didn't somebody tell me?

Posted by Dragonsoulj on 15 October 2015 - 09:55 PM

Why didn't somebody tell me that notepad++, with Ctrl+Shift+F, will search for text in all files recursively in a directory, then show you all occurrences in a separate window, and then open all the files with the search string marked.
 
How many hours of my life wasted with Windows search?  Never again.


I thought everyone saw the find in files tab of the search box. Saved myself so much trouble I got my company to add it to tghe approved programs list.


#5257238 Why didn't somebody tell me?

Posted by Dragonsoulj on 14 October 2015 - 03:28 PM

Dragging items or selections in an explorer window? Hold a mod key to get more actions. CTRL will give you copy I believe, while SHIFT will give you move (may be switched, but for sure gives those options).




#5254106 C++ Graphics Library

Posted by Dragonsoulj on 26 September 2015 - 03:27 AM


I'd recommend SFML. Although personally I'd recommend OpenGL but since you want to do a 2D, SFML or SDL2.

 

You can use OpenGL code alongside SFML, so once the ball gets rolling, it should be a fairly easy next step.




#5249839 Soldier background in tactical squad game?

Posted by Dragonsoulj on 31 August 2015 - 03:14 AM

Bodyguard might give bonuses to adjacent allies or be able to build buffs together through a developing (could be a stat) relationship. Fire Emblem has something like this but it is more just friendships and bonds.

 

Gangs/mafia might have the same following, either by being with their leader or bonuses in groups/surrounding enemies.






PARTNERS