Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Poetronic

#61
Bitteschön!  :)

Code (glbasic) Select
GLOBAL x#=100
GLOBAL y#=100
GLOBAL angle#=0
GLOBAL speed#=2

GLOBAL mx#,my#,b1,b2

SETSCREEN 640,480,0

WHILE TRUE

PRINT mx,10,10
PRINT my,10,20

LimitMouse()

DRAWRECT mx,my,32,32,RGB(255,0,0) // Mouse#
DRAWRECT x,y,32,32,RGB(255,255,255) // Object

MoveObjectToMouse()

SHOWSCREEN

WEND

FUNCTION LimitMouse:
MOUSESTATE mx, my,b1, b2
IF mx<0 THEN mx=0
IF mx>640-32 THEN mx=640-32
IF my<0 THEN my=0
IF my>480-32 THEN my=480-32
SETMOUSE mx, my
ENDFUNCTION

FUNCTION MoveObjectToMouse:
angle = ATAN(my - y, mx - x)
x=x+COS(angle)*speed
y=y+SIN(angle)*speed
ENDFUNCTION


In Deinem Code müsste es dann wohl heißen:

Code (glbasic) Select
phi = ATAN(mouse_y - pos_y, mouse_x - pos_x)
#62
Yes, as I said, design issues are still on my todo-list. I would like to get a 100% working version running first, and then I will take care of the design.

The level editor is fully functional indeed, although it is still fixed to the main set of levels. Storing/loading multiple files with different "parcours" is not possible yet. I wrote the editor mainly to be able to edit my own levels for the game, but I think a level editor with an online sharing option might be an interesting feature (way more interesting than a simple breakout clone obviously). But you could save your levels and send me the blocks.ini and items.ini - then I could play your levels ;-)

And yes, I've been reading a lot of threads about security issues and online stuff lately (I recommend Kitty's Networking for Cowards series), but I am very sure that it will take me at least a few more weeks time to really figure out how to do the stuff I have on my todo list...

#63
Sure, thanks for asking  :)

I said "parcours", but the actual game is pretty far from being innovative or anything. It is my first project, so I wanted to start with something basic and decided to to a little breakout clone (yeah, yawn, I know...).

Still, I am planning to include a level editor and an online hiscore. I would then love to add the possibility for players to share the the levels they created ("parcours") with other players, so that there is an individual hiscore for each of them. Perhaps that would make the game a bit more interesting, since the number of available levels would practicatlly be unlimited.

What I do have by now is:

- a working game mode with local hiscore and a still very rudimentary online hiscore
- a working level editor with the functionality listed in the specific screenshot
- a handful of blocks with different behavior like static, explosive (recursive), teleport etc.
- a handful of items to start with (player size, missiles, explosive ball, sticky ball, level up etc.)
- enemies shooting back at the player
- no screenshot function (I missed it very badly writing this post!)

There is still a lot on my todo-list (design, online functionality, level editing and so on), but I am pretty sure that I will get this project done within a few weeks from now.
#64
Kann man den Winkel zwischen Start- und zielkoordinate nicht wie folgt berechnen?

Code (glbasic) Select
winkel = ATAN(pos.y - mouse.y, pos.x - mouse.x)
#65
Yeah, hacked hiscores suck big time  :S

I think I might try something like this for hiscores and game data:


  • Create some string-keys for ENCRYPT$-function
  • Create some more strings
  • Add these strings to the existing data based on a more or less complex loop
  • Write the encrypted data in the files using a loop that switches the encryption keys
  • Load the data using the same routine

I think this solution is more or less necessary when encrypting data like 0,0,0,1,0,0,0,12,13,14,0,0,0... because otherwise you might be able to identify contents by the way they are repeated in the data-files.

Another issue might then be the online hiscores...
#66
Hi erico,

what exactly do you understand by "releasing the data as app propaganda"?

I am currently working on an encryption function for my level and highscore data. the ENCRYPT$/DECRYPT$ functions in GLBasic have already proven to be very helpful. In my case, protecting level data / hiscore files / online data etc. is of primary concern. If someone really feels the need to change the player/anim - so be it, why bother, since it doesn't change the game structure.

Right now, I am trying to let players create their own levels in a level editor and then have them upload their "parcours" to an online database, thus making their levels available to other players. This is still work in progress, but it's pretty obvious that players will need to be able to store their level-data locally, thus going beyond the single-exe-solution anyway, I guess...
#67
Although it doesn't solve the problem of protecting files and related issues, the following option lets you create a single .exe-file containing all your game folders/data/contents:

http://www.qbasicnews.com/dav/qb64tut/

This way, the contents of the rar/exe get temporarily extracted in some temp folder I guess. I think a lot of people might not really think of trying to "unrar" an executable (unless you didn't change the icon from rar to something else). It also works when the user doesn't have WinRAR installed (I uninstalled and it still worked). Maybe someone finds it helpful - until now I didn't even know that tcreating executables from WinRAR was possible. Still, it does not protect game contents or anything, it merely creates an executable from all your game files.
#68
Hello everyone,

just wanted to know if anyone in here is succuessfully using programs like Molebox or Smartpacker or something the like? I tried, but I failed with every single program (Windows 7 / 64 Bit). I either got some weird Windows errors or the software seemd totally buggy or the output was somewhat damaged (i.e. slighlty wrong window size). So I am really wondering whether those virtualization programs are really worth trying - not to mention the false virus alerts that some of them can trigger! I am still really, really hoping for an INCBIN-command like in BlitzMax (seems to be one of the MOST crucial features for GLBasic to me!), but in the meantime I would still love to be able to make a single exe-file from my game folder(s). At least I would love to be able to protect my game resources. Tips anyone?

Thank you!  :)

PS - I think that Molebox would be the program of my choice, but no matter what I do, I always get an error message that says "Cannot run packed executable -Reason- failed to create child process", or when I manually open the exe-file "The application has failed to start because its side-by-side configuration is incorrect". Has anyone experienced the same problem and knows what I might change in order to get it to work?
#69
Hey MrTAToad, average dt limiting is working now. Thanks for the advice!

What I do now: the program calculates an average deltatime based on 100 game loops and then limits the deltatime by that value. From what I can see, this solution works just fine.

:good:
#70
Hi everyone,

I am experiencing a problem with my deltatime calculations / animations when moving the program window.

When I press the windows key and then move the program window, the animation stops; but when I release the mouse button and the animation resumes, there seem to be some major floating point inaccuracies which break an animation of scrolling letters (angle-based movement / SIN / COS / deltatime). I believe the problem arises from the difference between the time the game is paused and the calculation fo floating point variables when the game is resumed.

Now my question is: Is it possible to just completely stop/pause/interrupt the whole program as soon as the program window is moved / out of focus? AUTOPAUSE TRUE/FALSE works for the program being out of focus, but not for moving the window. How should I deal with those rounding errors? I had a very nice chat with Wampus on IRC yesterday, but we didn't really find a satisfying solution to the problem yet (and Wampus knows a lot more about programming than I do obviously). Maybe someone can help?

Thank you! :-)
#71
Ok, sent you the link.
#72
Hahaha I guess I am a little too tired... same error, still had the dt = 16.6667 in my code... maybe you want to download the whole project and take a look at the weird behavior? I could upload it for you and PM you a link.
#73
Same problem...
#74
Ok, just to make sure I am doing it right:

Code (glbasic) Select

WHILE TRUE

        oldtime = timer
       
        // Game Loop

        timer = GETTIMERALL()
        dt = timer - oldtime

WEND


Is that correct? For the speed of the movement I have to use something like 8 now to make the letters move. Does that sound alright? :)
#75
Ok, will do. I thought GETTIMER() was specifically made for dt calculation, since it returns the exact amount of millisec passed since the last SHOWSCREEN. Guess I was wrong :)