Hello Guest, please login or register.
Did you miss your activation email?
Login with username, password and session length.

Pages: 1 2 [3]   Go Down

Author Topic: Getting Started  (Read 8025 times)

0 Members and 1 Guest are viewing this topic.
Re: Getting Started
« Reply #40 on: April 15, 2009, 04:59:27 am »
  • *
  • Reputation: +8/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6604
I am not sure exactly what you are saying and that is probably my fault. I can't remember how Game Maker fully handles this, but can you run a game maker file if there is code in a GML function that is for the registered version when you have the unregistered version (even if the registered version stuff is not called anywhere in the game)?

Also, I think I fixed the code. The idea came to me early this morning when I was working on my Unix assignment. Looks like this:
Code: [Select]
var hold_u, hold_d, hold_l, hold_r, move_factor;

hold_u = keyboard_check(vk_up);
hold_d = keyboard_check(vk_down);
hold_l = keyboard_check(vk_left);
hold_r = keyboard_check(vk_right);

if (hold_u && hold_d){
  hold_u = 0; hold_d = 0;
}

if (hold_l && hold_r){
  hold_l = 0; hold_r = 0;
}

switch (hold_u + hold_d + hold_l + hold_r){
  case 2:
    move_factor = sqrt(2); is_moving = true;
    switch (facing){
      case "U":
        if (hold_d)
          facing = "D";
        break;
      case "D":
        if (hold_u)
          facing = "U";
        break;
      case "L":
        if (hold_r)
          facing = "R";
        break;
      case "R":
        if (hold_l)
          facing = "L";
        break;
    }
    break;
  case 1:
    move_factor = 1; move_count = 0; is_moving = true;
    if (hold_u)
      facing = "U";
    else if (hold_d)
      facing = "D";
    else if (hold_l)
      facing = "L";
    else if (hold_r)
      facing = "R";
    break;
  case 0:
    move_factor = 0; move_count = 0; is_moving = false;
    break;
}

if (move_factor != 0){
  move_count += move_speed;
  while (move_count >= 1){
    if (place_free(x + hold_r - hold_l, y))
      x += hold_r - hold_l;
    else if (hold_u + hold_d == 0){
     
    }

    if (place_free(x, y + hold_d - hold_u))
      y += hold_d - hold_u;
    else if (hold_l + hold_r == 0){

    }
   
    move_count -= move_factor;
  }
}

I think that this should work. My early error in the movement code was that I had the diagonal movement based on potential ability to move, this works similarly except that it realizes that when you move non-diagonally, that potential does exist as you can only and should only move three times each step potentially if the move_speed is 3.

I am not fully sure how this will work with the corner cutting in that corner cutting happens when you are hitting something skewed, the corner cutting only really happens when you are only applying the keys to move non-diagonally. This is to say I am am not certain right now if the setting the move_count to 0 in the one switch statement will affect the speed of the corner cutting. It could be a little faster than true diagonal movement which when you think about it is kind of accurate in that you are not really moving purely diagonally.
Logged
Re: Getting Started
« Reply #41 on: April 15, 2009, 01:39:23 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 2245
I am not sure exactly what you are saying and that is probably my fault. I can't remember how Game Maker fully handles this, but can you run a game maker file if there is code in a GML function that is for the registered version when you have the unregistered version (even if the registered version stuff is not called anywhere in the game)?
Exactly, unless the registered functions are actually called, game maker will not throw up an error message.
Hence you could have something like,
Code: [Select]
if(PRO_VERSION)
{
// perform your data structure stuff here for us pro people
}
else
{
// or use an array based solution for us lite people
}
sort of thing.
Logged
Re: Getting Started
« Reply #42 on: April 19, 2009, 07:13:38 am »
  • *
  • Reputation: +8/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6604
Meh, I was too busy to get that worked into it and too lazy to test it, but here is what I got done so far. It includes left and right movement images, the corrected diagonal to non-diagonal delay, and redoing the facing variable such that the built-in direction variable is used instead. Still needs the corner cutting. I put a rock in the file because I was going to use that for testing the corner cutting and picking the object up and throwing it, but I haven't gotten around to it. Anywhere, it's attached.

I think that the first stable release of the engine should have two enemies, an NPC who can  be talked to and can move, and at least two Link objects which define their abilities based on how they can move (Link's actions can all be categorized based on the ability to change direction or not). This relies on a parent object system - includes using items likes a sword and shield (I have the shield and sword ripped just not fully usable).

The movement code again might also need to be changed such that movement in general is just movement and not directional changing; the good thing is that my movement code allows this easily - albeit necessary redundancy as non-directional changing doesn't use the code and directional changing has the same check twice. Then again, there might be an easier way to do this; it's easy to do though because the switch statement that checks the added value of the key presses does the directional checking.

This might mean the movement code will be rewritten a bit. Looking forward the actions of dashing with the sword and moving while on fire should be figured out too as those wouldn't work fully under the current movement system. Furthermore, an additional movement system for "bump back" will need to be devised for when Link is hit or when an enemy is hit.

As for working in the GM Lite/Pro thing, that could be implemented in the draw event primarily.

But yeah, attachment (the fps is 30 just because I got tired of setting it when it ran all the time):
Logged

Xiphirx

wat
Re: Getting Started
« Reply #43 on: April 26, 2009, 10:06:30 am »
  • Xiphirx
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3007
I think we should split the engine up in stages and not just keep it in one topic.

Example:

Topics:
-Getting started (Organizes the team)
-Basic Movement (Gets the movement down)

Then for every step, we add another topic. That way it is much more organized and less macro oriented.
Logged
  • For The Swarm
Re: Getting Started
« Reply #44 on: April 26, 2009, 05:01:02 pm »
  • *
  • Reputation: +8/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6604
Meh, I guess that sounds better in terms of organization. I cannot really work a lot more on the engine until my semester is over for my school though which is about two weeks away.
Logged

Zhello

N.A.D.I.
Re: Getting Started
« Reply #45 on: September 12, 2009, 03:50:05 am »
  • L'homme avec beaucoup de noms.
  • *
  • Reputation: +6/-1
  • Offline Offline
  • Gender: Male
  • Posts: 925
Is there anyway I could help out too? I worked on my game alone it gets boring so Ill work with you guys :)
Logged
The IT Guy
Intermediate Coder
Linux is a wonderful thing
~Linkwolf48/Gumstone1080~

The Legend of Zelda - New Beginnings

http://zfgc.com/forum/index.php?topic=34986.0
1.6 Demo -
https://www.dropbox.com/s/56km0iadaras56g/LoZNB%20Game%20Folder.rar?dl=0


Side Projects:

Dragon Diary - Cybernetic Threat
Story: http://wiki.zfgc.com/Cybernetic_Threat

Quote
Aero88
ZFGC is like the Hotel California.  You can come in but you can never leave!

devianart: http://linkwolf48.deviantart.com/
Re: Getting Started
« Reply #46 on: September 12, 2009, 05:12:02 am »
  • *
  • Reputation: +8/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6604
To be perfectly honest, a lot of what you do seems to just be asking for engines or taking the engines of others for your own use. A lot of the challenges of the GM Minish Cap Engine involve creating engine features which haven't been done so well or at all before and making them work together as one solid unit.

And really, the Community Project's source code is open to all users of ZFGC to use in their games; SO LONG AS CREDIT IS GIVEN TO ZFGC OF COURSE (Even if you are a user here, credit must be given for its use). The goal of the Community Project is to create something useful for users here, and in that same spirit user contributions should also be helpful and well-done. Otherwise, providing feedback to those working on it about the features they have implemented is also welcome so long as any criticism is constructive.
Logged
Pages: 1 2 [3]   Go Up

 


Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved



Page created in 0.158 seconds with 48 queries.

anything