Jump to content

  • Log In with Google      Sign In   
  • Create Account

Dragonsoulj

Member Since 15 Jun 2006
Offline Last Active Sep 13 2016 07:50 PM

#5309587 SFML converting local object coordinates to global coordinates

Posted by on 05 September 2016 - 08:45 PM

Something like this?

http://www.sfml-dev.org/documentation/2.4.0/classsf_1_1RenderTarget.php#a46eb08f775dd1420d6207ea87dde6e54

The sf::renderWindow has a few helper functions for going from world coordinates to screen coordinates.


#5302430 Create A Gaming Operating System

Posted by on 25 July 2016 - 01:13 AM

 

but I can't seem to find people who are showing you how to build on or modify OSs like Linux and FreeBSD
I don't understand what this means. Surely these people are easy to find. Linux OS is done by Linus Torvalds et al, BSD has a group of core developers as far as I know.

 

I very much doubt however that these are the people you need. They typically add or improve hardware drivers, and implement file systems, and virtual memory.

"The OS" in Unix context is however not much more than that.

 

Maybe you think that OS means more than "the kernel"? Your picture suggests you believe the graphical display is part of it, which is not the case (except for hardware access for displaying pixels). You may want to read about the structure of a Unix system (Unix is the name of the API of a broad variety of systems, which includes Linux and BSDs). For graphical system architecture, the structure of an X11 system looks like a good start to me.

 

 

If my assumptions are wrong, maybe you could explain in more detail what parts you think you should modify?

 

As a follow up to this, making a display manager and a window manager may be what you need to do. These can be applied to existing Linux installs to give you the look and feel you want.




#5299693 Why didn't somebody tell me?

Posted by on 07 July 2016 - 03:40 PM

Stumbled upon a neat trick in windows explorer that is really handy if you have a large directory of folders or files.
 
If your folder or file is name "StuffAndThings", with out having to click and use the search bar, just start typing "StuffAndThings" (like hitting the key for the first letter of the file to seek to all "s" files)  and explorer will eventually land on and highlight the folder or file for you =). This is useful if their are 50 things that start with "S".


You can also tap the first letter repeatedly to move among them. For instance, if you think your item started with S, just keep tapping S to jump among the files that start with S.


#5296888 Why didn't somebody tell me?

Posted by on 16 June 2016 - 09:00 PM

 

Isn't dist-upgrade just updating the kernels


apt-get upgrade does this, dist-upgrade upgrades everything... The problem comes when it tries to update glibc which is used by everything, so if it stops you can't log in, can't run anything, because it's a dependency of everything on the system...

 

 

I figured out what I was thinking of.
update collects your list of potential upgrades
upgrade updates your system

dist-upgrade updates your system and handles updating the changed dependency files

do-release-upgrade typically requires an option in your settings to be checked (or maybe a config file changed) before it works. This will update to newer versions, not just your kernels (of which mine are always held back under upgrade but update under dist-upgrade).

http://askubuntu.com/a/226213




#5272969 Recommendations for a Text Editor

Posted by 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 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 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 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 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 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 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 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 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 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 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?






PARTNERS