Welcome, Guest. Please login or register.

Author Topic: Ball isn't moving  (Read 3406 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline Omega Space ProtonsTopic starter

  • Newbie
  • *
  • Join Date: Oct 2010
  • Posts: 41
    • Show only replies by Omega Space Protons
Ball isn't moving
« on: November 01, 2010, 02:00:55 PM »
HI guys, i am having problems again with my code. This time i am trying to move a ball so it bounces off the sides of the screen. However for some reason the ball isn't moving at all as if the application is frozen, but it isn't. I have double checked my code for typos and i can't seem to find any. Any help in this matter would be appreciated.

Omega Space Protons
 

Offline Omega Space ProtonsTopic starter

  • Newbie
  • *
  • Join Date: Oct 2010
  • Posts: 41
    • Show only replies by Omega Space Protons
Re: Ball isn't moving
« Reply #1 on: November 03, 2010, 03:09:32 PM »
Sorry to double post, but it seems 88 people have seen my thread yet not a single reply has been made.

Omega Space Protons
 

Offline MickJT

  • Full Member
  • ***
  • Join Date: May 2004
  • Posts: 153
    • Show only replies by MickJT
    • http://members.iinet.net.au/~trebs/AmiMSN
Re: Ball isn't moving
« Reply #2 on: November 03, 2010, 03:27:18 PM »
I don't know any C/C++, but have you tried posting on UtilityBase?
 

Offline Omega Space ProtonsTopic starter

  • Newbie
  • *
  • Join Date: Oct 2010
  • Posts: 41
    • Show only replies by Omega Space Protons
Re: Ball isn't moving
« Reply #3 on: November 03, 2010, 07:18:42 PM »
Quote from: MickJT;589026
I don't know any C/C++, but have you tried posting on UtilityBase?


I'm glad you atleast Replied to my thread as having hundreds of people look at your thread and get no reply makes you want to have fits. Sorry to sound rude, it's just that when your developing games for an old system and no one is there to help you, you start to get depressed and think of quitting. Anyways what is UtilityBase and how do I access it?

Omega Space Protons
 

Offline SamuraiCrow

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2280
  • Country: us
  • Gender: Male
    • Show only replies by SamuraiCrow
Re: Ball isn't moving
« Reply #4 on: November 03, 2010, 07:41:08 PM »
Here's a link:  http://utilitybase.com/
 

Offline fishy_fiz

  • Hero Member
  • *****
  • Join Date: Jan 2005
  • Posts: 1813
    • Show only replies by fishy_fiz
Re: Ball isn't moving
« Reply #5 on: November 04, 2010, 08:48:39 AM »
Quote from: Omega Space Protons;589076
I'm glad you atleast Replied to my thread as having hundreds of people look at your thread and get no reply makes you want to have fits. Sorry to sound rude, it's just that when your developing games for an old system and no one is there to help you, you start to get depressed and think of quitting. Anyways what is UtilityBase and how do I access it?

Omega Space Protons


Could you be more of a whiner? ".. boohoo,... people have looked and havent automatically gone out of thier way to spend thier time to help me". What makes you so important that people should help at the drop of a hat ?  You do realise that sulking like this isnt going to help your cause?  I actually downloaded the sources last night and was going to help you when I got home today, but screw that,... not interetied in helping an ungrateful sulk now....
Near as I can tell this is where I write something under the guise of being innocuous, but really its a pot shot at another persons/peoples choice of Amiga based systems. Unfortunately only I cant see how transparent and petty it makes me look.
 

Offline Omega Space ProtonsTopic starter

  • Newbie
  • *
  • Join Date: Oct 2010
  • Posts: 41
    • Show only replies by Omega Space Protons
Re: Ball isn't moving
« Reply #6 on: November 04, 2010, 03:25:13 PM »
Quote from: fishy_fiz;589237
Could you be more of a whiner? ".. boohoo,... people have looked and haven't automatically gone out of their way to spend their time to help me". What makes you so important that people should help at the drop of a hat ?  You do realise that sulking like this isn't going to help your cause?  I actually downloaded the sources last night and was going to help you when I got home today, but screw that,... not interested in helping an ungrateful sulk now....
I apologise, I wasn't sulking just tired and frustrated as this system has been a pain to program. I didn't mean to take my frustration out on the Amiga community, i was just tired and cranky from trying to create my first Amiga game which I planned on releasing as open source so more games could be released for the Amiga to no avail.

Omega Space Projects
« Last Edit: November 04, 2010, 04:40:29 PM by Omega Space Protons »
 

Offline davideo

  • Sr. Member
  • ****
  • Join Date: Jan 2008
  • Posts: 415
  • Country: gb
  • Gender: Male
    • Show only replies by davideo
Re: Ball isn't moving
« Reply #7 on: November 04, 2010, 10:08:35 PM »
I've compiled this on my system and it tells me that the application is waiting for signals 0x40000000 to arrive.

Dave G

Edit: In fact if you comment out this line

signals = Wait(window_signal);

You will find the ball will bounce left and right as you wanted it to. BUT you can't close the window and on my OS3.9 4000D it will crash when killing the program.
« Last Edit: November 04, 2010, 10:48:23 PM by davideo »
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16867
  • Country: gb
  • Thanked: 4 times
    • Show only replies by Karlos
Re: Ball isn't moving
« Reply #8 on: November 04, 2010, 11:08:45 PM »
Quote
You will find the ball will bounce left and right as you wanted it to. BUT you can't close the window and on my OS3.9 4000D it will crash when killing the program.


Before closing the window and freeing the associated resources, you should ReplyMsg() any IDCMP messages that have piled up using a simple while loop. If you want to be extra safe, you can  also change your window's IDCMP flags first so that it can't receive any further messages.
int p; // A
 

Offline Omega Space ProtonsTopic starter

  • Newbie
  • *
  • Join Date: Oct 2010
  • Posts: 41
    • Show only replies by Omega Space Protons
Re: Ball isn't moving
« Reply #9 on: November 06, 2010, 07:30:54 PM »
That's weird cause the line:

Quote
signals = Wait(window_signal);
Is supposed to process all the signals a few lines after that there's a ReplyMsg() call which should cover the hanging 0x4000000000 signals problem. How do I reply to all IDCMP messages and also how do I prevent further IDCMP messages from occurring after the user closes the window?

Omega Space Protons
 

Offline mel_zoom

  • Full Member
  • ***
  • Join Date: Jan 2007
  • Posts: 231
    • Show only replies by mel_zoom
Re: Ball isn't moving
« Reply #10 on: November 06, 2010, 11:49:22 PM »
I think you need to call ModifyIDCMP(window, 0) to stop messages being sent to your window?

I am sure I saw an example for safe window closing in the "autodocs".
I love my MX5!
Please pay a visit
 

Offline nicholas

Re: Ball isn't moving
« Reply #11 on: November 07, 2010, 12:00:45 AM »
Quote from: mel_zoom;589989
I think you need to call ModifyIDCMP(window, 0) to stop messages being sent to your window?

I am sure I saw an example for safe window closing in the "autodocs".


Asalaamu alaykum ya ukhti.

Long time! :)
“Een rezhim-i eshghalgar-i Quds bayad az sahneh-i ruzgar mahv shaved.” - Imam Ayatollah Sayyed  Ruhollah Khomeini
 

Offline davideo

  • Sr. Member
  • ****
  • Join Date: Jan 2008
  • Posts: 415
  • Country: gb
  • Gender: Male
    • Show only replies by davideo
Re: Ball isn't moving
« Reply #12 on: November 07, 2010, 01:08:27 AM »
Quote from: Omega Space Protons;589932
That's weird cause the line:

signals = Wait(window_signal);

Is supposed to process all the signals a few lines after that there's a ReplyMsg() call which should cover the hanging 0x4000000000 signals problem. How do I reply to all IDCMP messages and also how do I prevent further IDCMP messages from occurring after the user closes the window?

Omega Space Protons


The problem is that the Wait command does just that - it sits and Waits - this is why your ball doesn't move.

The command you need to look into is GetMsg and the actual IDCMP flags you've got set.

Dave G :cool:
 

Offline Omega Space ProtonsTopic starter

  • Newbie
  • *
  • Join Date: Oct 2010
  • Posts: 41
    • Show only replies by Omega Space Protons
Re: Ball isn't moving
« Reply #13 on: November 12, 2010, 09:23:34 PM »
Quote from: mel_zoom;589989
I think you need to call ModifyIDCMP(window, 0) to stop messages being sent to your window?

I am sure I saw an example for safe window closing in the "autodocs".


Sorry, I don't have the Autodocs on CD and don't have a link to the autodocs which provide examples only to the ones which have the function references :'(. Could you please post a link to the autodocs examples?

Omega Space Protons

P.S. Sorry for the late reply, I'm away at the moment and don't have access easy access to the Internet.
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16867
  • Country: gb
  • Thanked: 4 times
    • Show only replies by Karlos
Re: Ball isn't moving
« Reply #14 on: November 12, 2010, 09:45:59 PM »
@Omega Space Protons

Buy this. You won't regret it.
int p; // A