Where do I start?
i would suggest doing one thing at a time starting with the very first thing you see when the program starts. again thats just a suggestion. i find its less overwhelming and then the other ideas and the rest of the program will follow, your end result and what you planned on may only have the title in common!!!!
Sorry it took me so long for to get this example up. It uses an image called "greenSquare.png", which you can find here : http://file-pasta.com/f/952.png
Put it in the same folder as your brutus2d source code and rename it greenSquare.png
This is just an example of 4-directional control as it would probably be used in a vertical shooter. I assume you're wanting to make a 2d rpg, so this is a good start. This is not how you do "frog throwing", which is used in RPGs and, strangely enough — Frogger. (thus the name). I didn't want to overwhelm you with code so this is the easiest I could think of. We'll get to frog throwing when you learn how this code works. Here it is :
Dim GreenSquare ' holds the player object image index Dim PlayerX ' holds the player object horizontal location Dim PlayerY ' holds the player object vertical location Dim GameOver ' set player object X and Y location playerX = 40 playerY = 40 graphics.Initialize 800, 600 key.Initialize greenSquare = graphics.LoadImage("greenSquare.png") gameOver = 0 Do ' Game Logic ' If the player hits ESCAPE or the X on the window, the game ends If key.Pressed(vk_escape) or key.Pressed(vk_windowx) Then gameOver = 1 ' Get player input and move the Player Object's X and Y postion If key.Pressed(vk_left) Then PlayerX = PlayerX - 1 If key.Pressed(vk_right) Then PlayerX = PlayerX + 1 If key.Pressed(vk_up) Then PlayerY = PlayerY - 1 If key.Pressed(vk_down) Then PlayerY = PlayerY + 1 ' Set the image in a new location graphics.SetXY greenSquare, PlayerX, PlayerY ' draw the frame graphics.Clear rgb(255,255,255) graphics.SetImage greenSquare graphics.SetFPS 60 graphics.Display Loop Until gameOver graphics.Terminate key.Terminate
Make sure that you save the Brutus2D source code before you run this. Otherwise, it won't know where the code is at in relation to the image, and therefore won't find it, even if it's in the same folder.